Alexander Makarov
876ef142c1
Remove explicit property initialization with null
2016-07-30 00:18:05 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Carsten Brandt
ee92cfa7ba
release version 2.0.9
2016-07-11 15:36:42 +02:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Robert Korulczyk
099b364b14
Fixed #9574 : Implicit run ColumnSchemaBuilder::null() when default value is set to null. ( #11813 )
2016-06-25 15:52:11 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Thiago
bafc8b3325
Fixes #10422 , #9574 : New proposal fix for ColumnSchemaBuilder not null column
...
* Added ability to explicitly set column nullability #10422
* Removed isNull property.
* add since tag.
2016-06-18 15:03:55 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
andrey-mokhov
bde00be202
ColumnSchemaBuilder can not work with custom types
...
In our project we use trait with custom types, example:
```php
trait MigrationToolTrait
{
protected function dateTimeWithTZ ($precision = null)
{
if ('pgsql' === $this->db->driverName) {
return $this->getDb()->getSchema()->createColumnSchemaBuilder(sprintf('timestamp(%d) with time zone', $precision));
}
return $this->dateTime($precision);
}
}
```
usage:
```php
class m160516_161900_init
{
use MigrationToolTrait;
public function safeUp ()
{
$this->createTable('testing', [
'id' => $this->primaryKey(),
'startDate' => $this->dateTimeWithTZ()->notNull()->defaultExpression('now()'),
]);
}
public function safeDown ()
{
$this->dropTable('testing');
}
}
```
In version 2.0.8 MigrateController generate notice:
PHP Notice 'yii\base\ErrorException' with message 'Undefined index: timestamp(0) with time zone' in vendor/yiisoft/yii2/db/ColumnSchemaBuilder.php:366
We offer our change to fix it.
2016-05-22 12:03:44 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Alexander Makarov
4d809af0ff
Fixed @since tag
2016-05-13 17:29:25 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Alexander Makarov
94d0bd9ae7
Fixed method name
2016-05-13 16:05:38 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Alexander Makarov
27866bf9d6
Changed name to append(), fixed phpdoc, added changelog
2016-05-13 15:58:06 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
66eabda770
Fixes #11195 : Added ability to append custom string to schema builder column definition
2016-05-13 15:57:54 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Carsten Brandt
731769241b
release version 2.0.8
2016-04-28 16:50:20 +02:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
SilverFire - Dmitry Naumenko
15432971d6
db/ColumnSchemaBuilder::buildCommentString() returns empty string by default
2016-04-20 09:26:07 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
SilverFire - Dmitry Naumenko
0fe27b9d3b
Refactored code in PR #9441
2016-04-19 17:48:25 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
SilverFire - Dmitry Naumenko
c9dfc90be0
Merge branch 'methods_for_schema_builder' of https://github.com/vaseninm/yii2 into vaseninm-methods_for_schema_builder
2016-04-19 12:21:33 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
5c4001d84b
Schema Builder Patterns Excel document in /docs folder (temp storage).
...
Fixed some schema builder patterns.
Added more information to upgrade docs.
2016-03-14 05:29:42 -07:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
98ac811858
Unsigned switch is now set when calling unsigned() on pks.
2016-02-26 19:58:35 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
2f91889b70
Removed unsignedPrimaryKey() schema builder type; now, the unsigned() modifier works with primary key types e.g. pk()->unsigned() or bigpk()->unsigned().
2016-02-26 17:48:03 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
b697e173fc
Fixed unsigned() modifier to enable use with PKs.
2016-02-26 14:14:52 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
553cca642c
Reverted unsigned() pk modifier
2016-02-26 06:09:22 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
030ee68b01
Testing unsigned() modifier on PKs (now $this->primaryKey()->unsigned() works)
2016-02-26 04:39:05 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
3761682edf
Upgraded some tests. Fixed MySQL test fixtures to create all tables with InnoDB.
2016-02-22 04:53:14 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
81ff4752d9
Added CHECK modifier to PK schema pattern. Modified UNSIGNED tests to not include modifier by default (i.e. only present when testing DBMSes that support it).
2016-02-22 04:06:17 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
96fa375b16
Refactored to a more functional way of accessing database connection
2016-02-21 05:05:54 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
f52f60db0f
Renamed category constants
2016-02-21 02:06:41 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
c50ba2e800
Fixed comment [skip ci]
2016-02-20 16:06:17 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
d18563bd38
Fixed comment formatting. Renamed ColumnSchemaBuilder::CAT_TEXT to ColumnSchemaBuilder::CAT_STRING. [skip ci]
2016-02-20 15:55:59 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
51b99320bd
Sqlite specific schema builder class actually gets loaded now
2016-02-20 06:53:31 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
0400eb9cee
Resolved merge conflict in changelog
2016-02-18 02:34:02 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Alexander Makarov
386aacae5c
Fixes #10422 : yii\db\ColumnSchemaBuilder::buildNotNullString now returns NULL instead of empty string to properly work with MSSQL (reverted from commit 2498a9b3bb)
2016-02-16 01:39:42 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
nevermnd
2498a9b3bb
Fixes #10422 : yii\db\ColumnSchemaBuilder::buildNotNullString now returns NULL instead of empty string to properly work with MSSQL
2016-02-15 23:55:34 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Carsten Brandt
e43c41c9ea
db layer phpdoc fixes
2016-02-07 16:33:26 +01:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
85fdc143d6
Documentation fix
2015-12-28 06:45:01 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Chris Harris
bce61bd474
Add after() option to migrations schema builder
2015-12-28 06:34:46 -08:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Alexander Makarov
5cecb09c1b
Fixes #9443 : Added unsigned() to ColumnSchemaBuilder
2015-12-26 15:20:21 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Alexander Makarov
7641d2d83b
Enhanced #9337 as @klimov-paul suggested in e94810551c (commitcomment-14335135)
2015-11-11 21:14:23 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Constantine Chuprik
e94810551c
Fixes #9337 : Added yii\db\ColumnSchemaBuilder::defaultExpression() to support DB Expression as default value
2015-11-11 20:42:07 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Matvey Vasenin
afda00d434
add sqllite dummy
2015-08-17 14:44:53 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Matvey Vasenin
c0c380e730
add comment to migration
2015-08-17 11:07:19 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Matvey Vasenin
3cc8c09898
some test case added
2015-08-17 10:17:51 +03:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Carsten Brandt
41b25e94b0
improved parameter naming and documentation of schemabuilder
...
changes according to #9191
close #9191
2015-08-04 11:58:41 +02:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)
Carsten Brandt
681db52ba6
refactored SchemaBuilder
...
- rename class to ColumnSchemaBuilder as this is more appropriate
- changed internal organisation to match how the rest of schema related classes work
- the ColumnSchemaBuilder is now created the same way as QueryBuilder is
- removed static call magic and method annotations, now real methods are called as they are
- the whole code works on objects in a db context now instead of setting database connection in global state
- trait is now used by Migration by default but can be used in other contexts as well
Migration usage is now as follows:
```php
$this->createTable('example_table', [
'id' => $this->primaryKey(),
'name' => $this->string(64)->notNull(),
'type' => $this->integer()->notNull()->defaultValue(10),
'description' => $this->text(),
'rule_name' => $this->string(64),
'data' => $this->text(),
'created_at' => $this->datetime()->notNull(),
'updated_at' => $this->datetime(),
]);
```
2015-08-03 23:25:50 +02:00
octicon-copy(16/)
octicon-file-diff(16/)
octicon-file-code(16/)