8 Commits

Author SHA1 Message Date
386aacae5c Fixes #10422: yii\db\ColumnSchemaBuilder::buildNotNullString now returns NULL instead of empty string to properly work with MSSQL (reverted from commit 2498a9b3bb8b1b535b0dfc451218217a63610eb7) 2016-02-16 01:39:42 +03:00
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
e43c41c9ea db layer phpdoc fixes 2016-02-07 16:33:26 +01:00
5cecb09c1b Fixes #9443: Added unsigned() to ColumnSchemaBuilder 2015-12-26 15:20:21 +03:00
7641d2d83b Enhanced #9337 as @klimov-paul suggested in e94810551c (commitcomment-14335135) 2015-11-11 21:14:23 +03:00
e94810551c Fixes #9337: Added yii\db\ColumnSchemaBuilder::defaultExpression() to support DB Expression as default value 2015-11-11 20:42:07 +03:00
41b25e94b0 improved parameter naming and documentation of schemabuilder
changes according to #9191
close #9191
2015-08-04 11:58:41 +02:00
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