SilverFire - Dmitry Naumenko
0fe27b9d3b
Refactored code in PR #9441
2016-04-19 17:48:25 +03:00
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
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
Chris Harris
98ac811858
Unsigned switch is now set when calling unsigned() on pks.
2016-02-26 19:58:35 -08:00
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
Chris Harris
b697e173fc
Fixed unsigned() modifier to enable use with PKs.
2016-02-26 14:14:52 -08:00
Chris Harris
553cca642c
Reverted unsigned() pk modifier
2016-02-26 06:09:22 -08:00
Chris Harris
030ee68b01
Testing unsigned() modifier on PKs (now $this->primaryKey()->unsigned() works)
2016-02-26 04:39:05 -08:00
Chris Harris
3761682edf
Upgraded some tests. Fixed MySQL test fixtures to create all tables with InnoDB.
2016-02-22 04:53:14 -08:00
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
Chris Harris
96fa375b16
Refactored to a more functional way of accessing database connection
2016-02-21 05:05:54 -08:00
Chris Harris
f52f60db0f
Renamed category constants
2016-02-21 02:06:41 -08:00
Chris Harris
c50ba2e800
Fixed comment [skip ci]
2016-02-20 16:06:17 -08:00
Chris Harris
d18563bd38
Fixed comment formatting. Renamed ColumnSchemaBuilder::CAT_TEXT to ColumnSchemaBuilder::CAT_STRING. [skip ci]
2016-02-20 15:55:59 -08:00
Chris Harris
51b99320bd
Sqlite specific schema builder class actually gets loaded now
2016-02-20 06:53:31 -08:00
Chris Harris
0400eb9cee
Resolved merge conflict in changelog
2016-02-18 02:34:02 -08:00
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
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
Carsten Brandt
e43c41c9ea
db layer phpdoc fixes
2016-02-07 16:33:26 +01:00
Chris Harris
85fdc143d6
Documentation fix
2015-12-28 06:45:01 -08:00
Chris Harris
bce61bd474
Add after() option to migrations schema builder
2015-12-28 06:34:46 -08:00
Alexander Makarov
5cecb09c1b
Fixes #9443 : Added unsigned() to ColumnSchemaBuilder
2015-12-26 15:20:21 +03:00
Alexander Makarov
7641d2d83b
Enhanced #9337 as @klimov-paul suggested in e94810551c (commitcomment-14335135)
2015-11-11 21:14:23 +03:00
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
Matvey Vasenin
afda00d434
add sqllite dummy
2015-08-17 14:44:53 +03:00
Matvey Vasenin
c0c380e730
add comment to migration
2015-08-17 11:07:19 +03:00
Matvey Vasenin
3cc8c09898
some test case added
2015-08-17 10:17:51 +03:00
Carsten Brandt
41b25e94b0
improved parameter naming and documentation of schemabuilder
...
changes according to #9191
close #9191
2015-08-04 11:58:41 +02:00
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