87 Commits

Author SHA1 Message Date
SG5
1141fc81a7 Fixes #12735: Fixed yii\console\controllers\MigrateController creating multiple primary keys for field bigPrimaryKey:unsigned 2016-12-02 01:03:24 +03:00
1157657cab Fixed incorrect order of migrations history in case yii\console\controllers\MigrateController::$migrationNamespaces is in use 2016-11-14 14:24:53 +02:00
5c3cdd792b fix code style 2016-11-12 18:15:27 +03:00
3d3d69e3a8 returned back orderBy() 2016-11-12 18:06:02 +03:00
50062d0b9f some change 2016-11-12 15:30:46 +03:00
c7c8f09827 ksort and reverse to uksort 2016-11-12 11:10:57 +03:00
481932e238 add migration name to sort 2016-11-12 02:20:00 +03:00
59f7335b8f change getMigrationHistory 2016-11-12 00:58:20 +03:00
b48b1a0657 Fixes #12904: Fixed lowercase table name in migrations 2016-11-08 23:39:44 +03:00
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
4f89265fff Fixes #12748: Migration generator now tries to fetch reference column name for foreignKey from schema if it's not set explicitly 2016-11-01 02:02:16 +03:00
8aa0e85a07 Add migration namespace support (#12511)
namespace support added to `BaseMigrateController`
2016-09-12 14:01:04 +03:00
8ec60e3d9b Merge branch '12423-migration-tool' of https://github.com/pana1990/yii2 into pana1990-12423-migration-tool 2016-09-11 21:17:43 +03:00
ae42d7b281 Fix #12423 Fix bug migration tool when creating fields with brackets in comment 2016-09-11 18:03:09 +02:00
496de65ee2 Fixes #12053: ./yii migrate/create was generating wrong code when using bigPrimaryKey 2016-08-05 01:09:55 +03:00
5992eea571 Fixes #11808: _table and _column suffixes are now required when generating migration 2016-07-04 12:50:37 +03:00
9d327baa8b coding style fixes 2016-05-26 11:19:32 +02:00
731769241b release version 2.0.8 2016-04-28 16:50:20 +02:00
4411a74ebd proper fix for #9425, adjust changes from #11363
includes tests and fix that works in all cases.
2016-04-28 01:29:07 +02:00
9ea5d46140 added missing @since annotations 2016-04-28 01:05:31 +02:00
7c663debd5 [ci skip] phpDoc updated (#11434) 2016-04-27 16:43:40 +03:00
de3c7d9d27 Fix MigrateController 2016-04-06 16:28:13 +03:00
6e96d881fd Merge branch 'master' of github.com:yiisoft/yii2 into migrate-fields-refactoring 2016-04-06 16:03:05 +03:00
b923adf75c Enh: Support for useTablePrefix parameter in migrate command
Fixes #11166: migrate command new option `useTablePrefix`
2016-04-06 13:37:37 +03:00
a90ffecdb3 MigrateController refactored avoiding internal state changing 2016-04-06 13:37:03 +03:00
b72524d490 Fixes #11280 migrate autogenerate breaks MongoDB migration
Fixes #11280: Descendants of `yii\console\controllers\BaseMigrateController`, like the one for MongoDB, unable to create new migration
2016-04-05 23:05:40 +03:00
49aec24ae1 Enh: Migrate command now supports foreign keys
Fixes #11207: migrate command can create foreign keys
2016-04-05 01:02:52 +03:00
705edfff5a Add aliases for core commands 2016-02-25 16:28:19 +01:00
5db772ef7b cleanup console namespace changes 2016-02-06 20:05:14 +01:00
cd87d67f34 Global DOCS update: ~~~ replaced with ``` 2015-12-02 23:15:28 +02:00
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