57 Commits

Author SHA1 Message Date
2a1764f97a Enhancements for #9465 2015-11-23 13:33:26 +03:00
76e8556d34 #9465 better naming, code polish, changelog, docs wording 2015-11-20 22:50:32 +03:00
9afd240ab6 Fixes #9465: ./yii migrate/create now generates code based on migration name and --fields 2015-11-20 22:08:47 +03:00
a6b8a30998 Removed unused "use" 2015-08-04 15:38:31 +03: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
da941a7675 Improved SchemaBuilder implementation 2015-07-08 15:40:09 +03:00
3872c6c565 Fix migrate/down order
Migrations were applied at the same time. This cause invalid sort order while downgrade.

Command `yii migrate `

Output:
```
Yii Migration Tool (based on Yii v2.0.4-dev)

Total 2 new migrations to be applied:
        m150402_075534_initial
        m150402_075544_feedback
```

Command `yii migrate/down 2`

```
Yii Migration Tool (based on Yii v2.0.4-dev)

Total 2 migrations to be reverted:
        m150402_075534_initial
        m150402_075544_feedback
```

In databasse
```
"m000000_000000_base";1428382302
"m150402_075534_initial";1428388855           <----
"m150402_075544_feedback";1428388855     <----
```
2015-04-07 12:01:09 +05:00
1713a99c79 Fixes #7924: Migrations in history are now ordered by time applied allowing to roll back in reverse order no matter how these were applied 2015-03-31 16:56:49 +03:00
2b6de9665e adjusted docs about #7347 2015-02-19 13:44:05 +01:00
84052d15df Used yii\di\Instance::ensure() in MigrateController instead of doing the same without it 2015-02-19 02:28:09 +03:00
9e42285f61 Reverted #3305 2014-11-28 17:13:52 +03:00
8b79293ff2 added missing @since annotations 2014-11-27 18:11:14 +01:00
5d7b70da5f Adjusted #3305: MigrateController::refreshSchema() is no more called automatically 2014-11-27 11:54:30 +03:00
7c5938f902 #4791: Added more colors to yii migrate command 2014-11-27 04:03:33 +03:00
3c70d3c317 Fixes #3305: yii migrate now automatically flushes DB schema cache after successful migration 2014-11-27 03:38:25 +03:00
00ca1cb4b3 Fixes #4914 2014-09-04 03:27:13 +04:00
3a1e0f3a5c property codestyle framework 2014-07-30 00:21:31 +02:00
6cc1310aed BaseMigrateController extracted 2014-06-17 17:49:21 +03:00
1414f9ab6b limit condition changed 2014-05-28 18:06:11 +04:00
d229cb8206 limit applied to migration 2014-05-27 18:36:41 +04:00
f5b7788edd MigrateController refactoring 2014-05-14 13:22:04 +04:00
697e909c30 Comments updated 2014-05-09 18:33:22 +04:00
5f2101893e MigrateCommand enhancement. all option added for down action. 2014-05-09 18:30:38 +04:00
a86d2ad11e Added yii\console\Controller::EXIT_CODE_NORMAL and yii\console\Controller::EXIT_CODE_ERROR constants, yii\console\MigrateController now returns yii\console\Controller::EXIT_CODE_ERROR in case of failed migration 2014-05-07 03:11:35 +04:00
ff3a20a785 Removed duplicate property 2014-05-06 21:02:35 +04:00
c1445871f4 Correction of many errors code inspection.
Adjustments code according to the standards.
Adding missing PHPDoc comment.
2014-04-16 19:29:07 -03:00
3c400dbca8 fixed file PHPdoc
issue #3026
2014-04-10 22:10:59 +02:00
ab799d8ea9 Fixes #2911: Removed tbl_ default for table prefix 2014-03-30 19:33:46 +04:00
67dd874e0c renamed console controller optoins param $id to $actionId 2014-03-26 17:51:52 +01:00
bf3c75147d reverted breaking PHPdoc codestyle changes
issue #2852
2014-03-23 20:51:09 +01:00
8c2e39235f Turn module and application into DI containers. 2014-03-17 23:57:01 -04:00
b5f8a4dc22 Reformat code te be PSR-2 compatible 2014-03-16 10:46:21 +06:00
0051a1ece4 sort options by action in Migration controller 2014-03-09 22:47:05 +01:00
706ab7f968 combine globalOptions() with local options into options($id)
adjust existing Console Controllers and docs
2014-03-09 22:45:04 +01:00
740a769477 improved HelpController with messages for each command 2014-03-06 22:43:57 +01:00
65dd8c9e7e Add ability to downgrade migrations by the absolute apply time 2014-02-20 16:03:22 +06:00
5cab2a8745 Fixes #2156: yii migrate now automatically creates migrations directory if it does not exist 2014-01-27 06:57:22 +04:00
b8558a860a fixed migrate command output 2014-01-21 17:09:29 +01:00
3de7bce631 Migration command show correct directory path while it not exist 2014-01-13 06:53:25 +04:00
0c38655217 psr-4 move 2014-01-10 21:41:43 -05:00
0d814fa523 Moved "framework" to "iii". 2013-05-09 12:00:15 -04:00
d7df7053e0 === array() => empty() 2013-05-07 19:51:29 +04:00
e1acc64b2b refactoring cache and db references. 2013-03-27 17:09:18 -04:00
884977a724 renamed util to helpers. 2013-03-23 15:32:26 -04:00
1d48d01ef7 refactored View. 2013-03-20 22:03:13 -04:00
4fdaab3560 updated file header. 2013-03-04 08:03:46 -05:00
a07a67ad8d minor fix of console commands. 2013-02-05 16:17:07 -05:00
8b2b7915b4 Renamed application to app. 2013-02-05 16:12:22 -05:00
af4455eb03 Finished console support.
Finished migrate command.
2013-02-03 19:37:29 -05:00
b2662c0cd9 clean up help command. 2013-02-02 23:36:20 -05:00