diff --git a/src/generator/default/dbmodel.php b/src/generator/default/dbmodel.php index 17fa4a84..a3d269b6 100644 --- a/src/generator/default/dbmodel.php +++ b/src/generator/default/dbmodel.php @@ -49,8 +49,8 @@ */ abstract class getClassName() ?> extends \yii\db\ActiveRecord { -getScenarios()): -foreach($scenarios as $scenario): ?> +getScenarios()): +foreach ($scenarios as $scenario): ?> /** * @@ -76,7 +76,7 @@ public static function tableName() { return getTableAlias()) ?>; } - + /** * Automatically generated scenarios from the model 'x-scenarios'. @@ -92,7 +92,7 @@ public function scenarios() $default = parent::scenarios()[self::SCENARIO_DEFAULT]; return [ - + self:: => $default, /** diff --git a/tests/specs/blog/migrations/m200000_000002_create_table_blog_posts.php b/tests/specs/blog/migrations/m200000_000002_create_table_blog_posts.php index b0b8e371..c7cc90fb 100644 --- a/tests/specs/blog/migrations/m200000_000002_create_table_blog_posts.php +++ b/tests/specs/blog/migrations/m200000_000002_create_table_blog_posts.php @@ -11,10 +11,10 @@ public function up() 0 => 'uid varchar(128) NOT NULL', 'title' => $this->string(255)->notNull(), 'slug' => $this->string(200)->null()->defaultValue(null), - 'category_id' => $this->integer()->notNull(), + 'category_id' => $this->integer()->notNull()->comment('Category of posts'), 'active' => $this->boolean()->notNull()->defaultValue(false), 'created_at' => $this->date()->null()->defaultValue(null), - 'created_by_id' => $this->integer()->null()->defaultValue(null), + 'created_by_id' => $this->integer()->null()->defaultValue(null)->comment('The User'), ]); $this->addPrimaryKey('pk_blog_posts_uid', '{{%blog_posts}}', 'uid'); $this->createIndex('blog_posts_title_key', '{{%blog_posts}}', 'title', true); diff --git a/tests/specs/blog/migrations/m200000_000004_create_table_post_comments.php b/tests/specs/blog/migrations/m200000_000004_create_table_post_comments.php index c16766da..175a32b7 100644 --- a/tests/specs/blog/migrations/m200000_000004_create_table_post_comments.php +++ b/tests/specs/blog/migrations/m200000_000004_create_table_post_comments.php @@ -9,8 +9,8 @@ public function up() { $this->createTable('{{%post_comments}}', [ 'id' => $this->bigPrimaryKey(), - 'post_id' => $this->string(128)->notNull(), - 'author_id' => $this->integer()->notNull(), + 'post_id' => $this->string(128)->notNull()->comment('A blog post (uid used as pk for test purposes)'), + 'author_id' => $this->integer()->notNull()->comment('The User'), 0 => 'message json NOT NULL', 1 => 'meta_data json NOT NULL', 'created_at' => $this->integer()->notNull(), diff --git a/tests/specs/blog/migrations_maria_db/m200000_000002_create_table_blog_posts.php b/tests/specs/blog/migrations_maria_db/m200000_000002_create_table_blog_posts.php index b0b8e371..c7cc90fb 100644 --- a/tests/specs/blog/migrations_maria_db/m200000_000002_create_table_blog_posts.php +++ b/tests/specs/blog/migrations_maria_db/m200000_000002_create_table_blog_posts.php @@ -11,10 +11,10 @@ public function up() 0 => 'uid varchar(128) NOT NULL', 'title' => $this->string(255)->notNull(), 'slug' => $this->string(200)->null()->defaultValue(null), - 'category_id' => $this->integer()->notNull(), + 'category_id' => $this->integer()->notNull()->comment('Category of posts'), 'active' => $this->boolean()->notNull()->defaultValue(false), 'created_at' => $this->date()->null()->defaultValue(null), - 'created_by_id' => $this->integer()->null()->defaultValue(null), + 'created_by_id' => $this->integer()->null()->defaultValue(null)->comment('The User'), ]); $this->addPrimaryKey('pk_blog_posts_uid', '{{%blog_posts}}', 'uid'); $this->createIndex('blog_posts_title_key', '{{%blog_posts}}', 'title', true); diff --git a/tests/specs/blog/migrations_maria_db/m200000_000004_create_table_post_comments.php b/tests/specs/blog/migrations_maria_db/m200000_000004_create_table_post_comments.php index d4971f43..5883fa5b 100644 --- a/tests/specs/blog/migrations_maria_db/m200000_000004_create_table_post_comments.php +++ b/tests/specs/blog/migrations_maria_db/m200000_000004_create_table_post_comments.php @@ -9,8 +9,8 @@ public function up() { $this->createTable('{{%post_comments}}', [ 'id' => $this->bigPrimaryKey(), - 'post_id' => $this->string(128)->notNull(), - 'author_id' => $this->integer()->notNull(), + 'post_id' => $this->string(128)->notNull()->comment('A blog post (uid used as pk for test purposes)'), + 'author_id' => $this->integer()->notNull()->comment('The User'), 0 => 'message json NOT NULL DEFAULT \'[]\'', 1 => 'meta_data json NOT NULL DEFAULT \'[]\'', 'created_at' => $this->integer()->notNull(), diff --git a/tests/specs/blog/migrations_mysql_db/m200000_000002_create_table_blog_posts.php b/tests/specs/blog/migrations_mysql_db/m200000_000002_create_table_blog_posts.php index b0b8e371..c7cc90fb 100644 --- a/tests/specs/blog/migrations_mysql_db/m200000_000002_create_table_blog_posts.php +++ b/tests/specs/blog/migrations_mysql_db/m200000_000002_create_table_blog_posts.php @@ -11,10 +11,10 @@ public function up() 0 => 'uid varchar(128) NOT NULL', 'title' => $this->string(255)->notNull(), 'slug' => $this->string(200)->null()->defaultValue(null), - 'category_id' => $this->integer()->notNull(), + 'category_id' => $this->integer()->notNull()->comment('Category of posts'), 'active' => $this->boolean()->notNull()->defaultValue(false), 'created_at' => $this->date()->null()->defaultValue(null), - 'created_by_id' => $this->integer()->null()->defaultValue(null), + 'created_by_id' => $this->integer()->null()->defaultValue(null)->comment('The User'), ]); $this->addPrimaryKey('pk_blog_posts_uid', '{{%blog_posts}}', 'uid'); $this->createIndex('blog_posts_title_key', '{{%blog_posts}}', 'title', true); diff --git a/tests/specs/blog/migrations_mysql_db/m200000_000004_create_table_post_comments.php b/tests/specs/blog/migrations_mysql_db/m200000_000004_create_table_post_comments.php index c16766da..175a32b7 100644 --- a/tests/specs/blog/migrations_mysql_db/m200000_000004_create_table_post_comments.php +++ b/tests/specs/blog/migrations_mysql_db/m200000_000004_create_table_post_comments.php @@ -9,8 +9,8 @@ public function up() { $this->createTable('{{%post_comments}}', [ 'id' => $this->bigPrimaryKey(), - 'post_id' => $this->string(128)->notNull(), - 'author_id' => $this->integer()->notNull(), + 'post_id' => $this->string(128)->notNull()->comment('A blog post (uid used as pk for test purposes)'), + 'author_id' => $this->integer()->notNull()->comment('The User'), 0 => 'message json NOT NULL', 1 => 'meta_data json NOT NULL', 'created_at' => $this->integer()->notNull(), diff --git a/tests/specs/blog/migrations_pgsql_db/m200000_000002_create_table_blog_posts.php b/tests/specs/blog/migrations_pgsql_db/m200000_000002_create_table_blog_posts.php index 8639040d..a7266997 100644 --- a/tests/specs/blog/migrations_pgsql_db/m200000_000002_create_table_blog_posts.php +++ b/tests/specs/blog/migrations_pgsql_db/m200000_000002_create_table_blog_posts.php @@ -11,10 +11,10 @@ public function safeUp() 0 => '"uid" varchar(128) NOT NULL', 'title' => $this->string(255)->notNull(), 'slug' => $this->string(200)->null()->defaultValue(null), - 'category_id' => $this->integer()->notNull(), + 'category_id' => $this->integer()->notNull()->comment('Category of posts'), 'active' => $this->boolean()->notNull()->defaultValue(false), 'created_at' => $this->date()->null()->defaultValue(null), - 'created_by_id' => $this->integer()->null()->defaultValue(null), + 'created_by_id' => $this->integer()->null()->defaultValue(null)->comment('The User'), ]); $this->addPrimaryKey('pk_blog_posts_uid', '{{%blog_posts}}', 'uid'); $this->createIndex('blog_posts_title_key', '{{%blog_posts}}', 'title', true); diff --git a/tests/specs/blog/migrations_pgsql_db/m200000_000004_create_table_post_comments.php b/tests/specs/blog/migrations_pgsql_db/m200000_000004_create_table_post_comments.php index 2aa48549..1229677b 100644 --- a/tests/specs/blog/migrations_pgsql_db/m200000_000004_create_table_post_comments.php +++ b/tests/specs/blog/migrations_pgsql_db/m200000_000004_create_table_post_comments.php @@ -9,8 +9,8 @@ public function safeUp() { $this->createTable('{{%post_comments}}', [ 'id' => $this->bigPrimaryKey(), - 'post_id' => $this->string(128)->notNull(), - 'author_id' => $this->integer()->notNull(), + 'post_id' => $this->string(128)->notNull()->comment('A blog post (uid used as pk for test purposes)'), + 'author_id' => $this->integer()->notNull()->comment('The User'), 0 => '"message" json NOT NULL DEFAULT \'[]\'', 1 => '"meta_data" json NOT NULL DEFAULT \'[]\'', 'created_at' => $this->integer()->notNull(), diff --git a/tests/specs/blog_v2/migrations_maria_db/m200000_000005_change_table_v2_comments.php b/tests/specs/blog_v2/migrations_maria_db/m200000_000005_change_table_v2_comments.php index 75553729..e2f7b4ad 100644 --- a/tests/specs/blog_v2/migrations_maria_db/m200000_000005_change_table_v2_comments.php +++ b/tests/specs/blog_v2/migrations_maria_db/m200000_000005_change_table_v2_comments.php @@ -9,7 +9,7 @@ public function up() { $this->dropForeignKey('fk_v2_comments_post_id_v2_posts_uid', '{{%v2_comments}}'); $this->dropForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}'); - $this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)->after('post_id')); + $this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)->after('post_id')->comment('The User')); $this->dropColumn('{{%v2_comments}}', 'author_id'); $this->alterColumn('{{%v2_comments}}', 'message', $this->text()->notNull()); $this->alterColumn('{{%v2_comments}}', 'meta_data', $this->string(300)->null()->defaultValue('')); diff --git a/tests/specs/blog_v2/migrations_mysql_db/m200000_000005_change_table_v2_comments.php b/tests/specs/blog_v2/migrations_mysql_db/m200000_000005_change_table_v2_comments.php index 5861542c..130014e7 100644 --- a/tests/specs/blog_v2/migrations_mysql_db/m200000_000005_change_table_v2_comments.php +++ b/tests/specs/blog_v2/migrations_mysql_db/m200000_000005_change_table_v2_comments.php @@ -9,7 +9,7 @@ public function up() { $this->dropForeignKey('fk_v2_comments_post_id_v2_posts_uid', '{{%v2_comments}}'); $this->dropForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}'); - $this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)->after('post_id')); + $this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)->after('post_id')->comment('The User')); $this->dropColumn('{{%v2_comments}}', 'author_id'); $this->alterColumn('{{%v2_comments}}', 'message', $this->text()->notNull()); $this->alterColumn('{{%v2_comments}}', 'meta_data', $this->string(300)->null()->defaultValue('')); diff --git a/tests/specs/blog_v2/migrations_pgsql_db/m200000_000005_change_table_v2_comments.php b/tests/specs/blog_v2/migrations_pgsql_db/m200000_000005_change_table_v2_comments.php index 99a896c6..452a4401 100644 --- a/tests/specs/blog_v2/migrations_pgsql_db/m200000_000005_change_table_v2_comments.php +++ b/tests/specs/blog_v2/migrations_pgsql_db/m200000_000005_change_table_v2_comments.php @@ -9,7 +9,7 @@ public function safeUp() { $this->dropForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}'); $this->dropForeignKey('fk_v2_comments_post_id_v2_posts_uid', '{{%v2_comments}}'); - $this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)); + $this->addColumn('{{%v2_comments}}', 'user_id', $this->bigInteger()->null()->defaultValue(null)->comment('The User')); $this->dropColumn('{{%v2_comments}}', 'author_id'); $this->alterColumn('{{%v2_comments}}', 'message', 'text NOT NULL USING "message"::text'); $this->alterColumn('{{%v2_comments}}', 'message', "DROP DEFAULT"); diff --git a/tests/specs/fk_col_name/app/migrations_mysql_db/m200000_000002_create_table_webhooks.php b/tests/specs/fk_col_name/app/migrations_mysql_db/m200000_000002_create_table_webhooks.php index bb6aa050..5d3abaf3 100644 --- a/tests/specs/fk_col_name/app/migrations_mysql_db/m200000_000002_create_table_webhooks.php +++ b/tests/specs/fk_col_name/app/migrations_mysql_db/m200000_000002_create_table_webhooks.php @@ -10,7 +10,7 @@ public function up() $this->createTable('{{%webhooks}}', [ 'id' => $this->primaryKey(), 'name' => $this->text()->null(), - 'user_id' => $this->integer()->null()->defaultValue(null), + 'user_id' => $this->integer()->null()->defaultValue(null)->comment('Test model for model code generation that should not contain id column in rules'), 'redelivery_of' => $this->integer()->null()->defaultValue(null), ]); $this->addForeignKey('fk_webhooks_user_id_users_id', '{{%webhooks}}', 'user_id', '{{%users}}', 'id'); diff --git a/tests/specs/fk_col_name_index/app/migrations_mysql_db/m200000_000002_create_table_webhooks.php b/tests/specs/fk_col_name_index/app/migrations_mysql_db/m200000_000002_create_table_webhooks.php index 783d58b0..591905a0 100644 --- a/tests/specs/fk_col_name_index/app/migrations_mysql_db/m200000_000002_create_table_webhooks.php +++ b/tests/specs/fk_col_name_index/app/migrations_mysql_db/m200000_000002_create_table_webhooks.php @@ -10,7 +10,7 @@ public function up() $this->createTable('{{%webhooks}}', [ 'id' => $this->primaryKey(), 'name' => $this->string(255)->null()->defaultValue(null), - 'user_id' => $this->integer()->null()->defaultValue(null), + 'user_id' => $this->integer()->null()->defaultValue(null)->comment('Test model for model code generation that should not contain id column in rules'), 'redelivery_of' => $this->integer()->null()->defaultValue(null), 'rd_abc_2' => $this->integer()->null()->defaultValue(null), ]); diff --git a/tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000000_create_table_accounts.php b/tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000000_create_table_accounts.php index 1606f2fc..ce7db4f9 100644 --- a/tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000000_create_table_accounts.php +++ b/tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000000_create_table_accounts.php @@ -9,7 +9,7 @@ public function up() { $this->createTable('{{%accounts}}', [ 'id' => $this->primaryKey(), - 'name' => $this->string(128)->notNull(), + 'name' => $this->string(128)->notNull()->comment('account name'), 'paymentMethodName' => $this->text()->null(), ]); } diff --git a/tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000001_create_table_contacts.php b/tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000001_create_table_contacts.php index 5fcda9dc..a706a626 100644 --- a/tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000001_create_table_contacts.php +++ b/tests/specs/issue_fix/175_bug_allof_with_multiple_dollarrefs/pgsql/migrations_pgsql_db/m200000_000001_create_table_contacts.php @@ -9,7 +9,7 @@ public function up() { $this->createTable('{{%contacts}}', [ 'id' => $this->primaryKey(), - 'account_id' => $this->integer()->notNull(), + 'account_id' => $this->integer()->notNull()->comment('Account'), 'active' => $this->boolean()->null()->defaultValue(false), 'nickname' => $this->text()->null(), ]); diff --git a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000001_create_table_b123s.php b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000001_create_table_b123s.php index 908bd998..7fe423f5 100644 --- a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000001_create_table_b123s.php +++ b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000001_create_table_b123s.php @@ -10,7 +10,7 @@ public function safeUp() $this->createTable('{{%b123s}}', [ 'id' => $this->primaryKey(), 'name' => $this->text()->null()->defaultValue(null), - 'c123_id' => $this->integer()->null()->defaultValue(null), + 'c123_id' => $this->integer()->null()->defaultValue(null)->comment('desc'), ]); $this->addForeignKey('fk_b123s_c123_id_c123s_id', '{{%b123s}}', 'c123_id', '{{%c123s}}', 'id'); } diff --git a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000002_create_table_a123s.php b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000002_create_table_a123s.php index 73c70ae2..4b2aad61 100644 --- a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000002_create_table_a123s.php +++ b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000002_create_table_a123s.php @@ -10,7 +10,7 @@ public function safeUp() $this->createTable('{{%a123s}}', [ 'id' => $this->primaryKey(), 'name' => $this->text()->null()->defaultValue(null), - 'b123_id' => $this->integer()->null()->defaultValue(null), + 'b123_id' => $this->integer()->null()->defaultValue(null)->comment('desc'), ]); $this->addForeignKey('fk_a123s_b123_id_b123s_id', '{{%a123s}}', 'b123_id', '{{%b123s}}', 'id'); } diff --git a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000003_create_table_accounts.php b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000003_create_table_accounts.php index 8eba95b2..843678d6 100644 --- a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000003_create_table_accounts.php +++ b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000003_create_table_accounts.php @@ -9,7 +9,7 @@ public function safeUp() { $this->createTable('{{%accounts}}', [ 'id' => $this->primaryKey(), - 'name' => $this->string(40)->notNull(), + 'name' => $this->string(40)->notNull()->comment('account name'), ]); } diff --git a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000005_create_table_domains.php b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000005_create_table_domains.php index c830fe7e..871b473f 100644 --- a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000005_create_table_domains.php +++ b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000005_create_table_domains.php @@ -9,8 +9,8 @@ public function safeUp() { $this->createTable('{{%domains}}', [ 'id' => $this->primaryKey(), - 'name' => $this->string(128)->notNull(), - 'account_id' => $this->integer()->notNull(), + 'name' => $this->string(128)->notNull()->comment('domain or sub-domain name, in DNS syntax, IDN are converted'), + 'account_id' => $this->integer()->notNull()->comment('user account'), 0 => '"created_at" timestamp NOT NULL', ]); $this->addForeignKey('fk_domains_account_id_accounts_id', '{{%domains}}', 'account_id', '{{%accounts}}', 'id'); diff --git a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000006_create_table_e123s.php b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000006_create_table_e123s.php index f8d58a41..59d643a4 100644 --- a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000006_create_table_e123s.php +++ b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000006_create_table_e123s.php @@ -10,7 +10,7 @@ public function safeUp() $this->createTable('{{%e123s}}', [ 'id' => $this->primaryKey(), 'name' => $this->text()->null()->defaultValue(null), - 'b123_id' => $this->integer()->null()->defaultValue(null), + 'b123_id' => $this->integer()->null()->defaultValue(null)->comment('desc'), ]); $this->addForeignKey('fk_e123s_b123_id_b123s_id', '{{%e123s}}', 'b123_id', '{{%b123s}}', 'id'); } diff --git a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000007_create_table_routings.php b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000007_create_table_routings.php index 98ac2ad9..f880d830 100644 --- a/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000007_create_table_routings.php +++ b/tests/specs/relations_in_faker/app/migrations_pgsql_db/m200000_000007_create_table_routings.php @@ -9,14 +9,14 @@ public function safeUp() { $this->createTable('{{%routings}}', [ 'id' => $this->primaryKey(), - 'domain_id' => $this->integer()->notNull(), + 'domain_id' => $this->integer()->notNull()->comment('domain'), 'path' => $this->string(255)->null()->defaultValue(null), 'ssl' => $this->boolean()->null()->defaultValue(null), 'redirect_to_ssl' => $this->boolean()->null()->defaultValue(null), 'service' => $this->string(255)->null()->defaultValue(null), 0 => '"created_at" timestamp NULL DEFAULT NULL', - 'd123_id' => $this->integer()->null()->defaultValue(null), - 'a123_id' => $this->integer()->null()->defaultValue(null), + 'd123_id' => $this->integer()->null()->defaultValue(null)->comment('desc'), + 'a123_id' => $this->integer()->null()->defaultValue(null)->comment('desc'), ]); $this->addForeignKey('fk_routings_domain_id_domains_id', '{{%routings}}', 'domain_id', '{{%domains}}', 'id'); $this->addForeignKey('fk_routings_d123_id_d123s_id', '{{%routings}}', 'd123_id', '{{%d123s}}', 'id'); diff --git a/tests/specs/x_db_type/edit_column/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php b/tests/specs/x_db_type/edit_column/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php index 1e27d8d6..7c0b936f 100644 --- a/tests/specs/x_db_type/edit_column/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php +++ b/tests/specs/x_db_type/edit_column/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php @@ -19,7 +19,7 @@ public function up() 7 => 'col_9 varchar(9) NULL DEFAULT NULL', 8 => 'col_10 varchar(10) NULL DEFAULT NULL', 9 => 'col_11 text NULL DEFAULT NULL', - 10 => 'price decimal(10,2) NULL DEFAULT 0', + 10 => 'price decimal(10,2) NULL DEFAULT 0 COMMENT \'price in EUR\'', ]); } diff --git a/tests/specs/x_db_type/edit_column/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php b/tests/specs/x_db_type/edit_column/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php index 3e9e8e02..50881e9d 100644 --- a/tests/specs/x_db_type/edit_column/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php +++ b/tests/specs/x_db_type/edit_column/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php @@ -19,7 +19,7 @@ public function up() 7 => 'col_9 varchar(9) NULL DEFAULT NULL', 8 => 'col_10 varchar(10) NULL DEFAULT NULL', 9 => 'col_11 text NULL', - 10 => 'price decimal(10,2) NULL DEFAULT 0', + 10 => 'price decimal(10,2) NULL DEFAULT 0 COMMENT \'price in EUR\'', ]); } diff --git a/tests/specs/x_db_type/fresh/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php b/tests/specs/x_db_type/fresh/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php index 1e27d8d6..7c0b936f 100644 --- a/tests/specs/x_db_type/fresh/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php +++ b/tests/specs/x_db_type/fresh/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php @@ -19,7 +19,7 @@ public function up() 7 => 'col_9 varchar(9) NULL DEFAULT NULL', 8 => 'col_10 varchar(10) NULL DEFAULT NULL', 9 => 'col_11 text NULL DEFAULT NULL', - 10 => 'price decimal(10,2) NULL DEFAULT 0', + 10 => 'price decimal(10,2) NULL DEFAULT 0 COMMENT \'price in EUR\'', ]); } diff --git a/tests/specs/x_db_type/fresh/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php b/tests/specs/x_db_type/fresh/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php index 3e9e8e02..50881e9d 100644 --- a/tests/specs/x_db_type/fresh/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php +++ b/tests/specs/x_db_type/fresh/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php @@ -19,7 +19,7 @@ public function up() 7 => 'col_9 varchar(9) NULL DEFAULT NULL', 8 => 'col_10 varchar(10) NULL DEFAULT NULL', 9 => 'col_11 text NULL', - 10 => 'price decimal(10,2) NULL DEFAULT 0', + 10 => 'price decimal(10,2) NULL DEFAULT 0 COMMENT \'price in EUR\'', ]); } diff --git a/tests/specs/x_db_type/new_column/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php b/tests/specs/x_db_type/new_column/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php index 1e27d8d6..7c0b936f 100644 --- a/tests/specs/x_db_type/new_column/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php +++ b/tests/specs/x_db_type/new_column/maria/app/migrations_maria_db/m200000_000003_create_table_pristines.php @@ -19,7 +19,7 @@ public function up() 7 => 'col_9 varchar(9) NULL DEFAULT NULL', 8 => 'col_10 varchar(10) NULL DEFAULT NULL', 9 => 'col_11 text NULL DEFAULT NULL', - 10 => 'price decimal(10,2) NULL DEFAULT 0', + 10 => 'price decimal(10,2) NULL DEFAULT 0 COMMENT \'price in EUR\'', ]); } diff --git a/tests/specs/x_db_type/new_column/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php b/tests/specs/x_db_type/new_column/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php index 3e9e8e02..50881e9d 100644 --- a/tests/specs/x_db_type/new_column/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php +++ b/tests/specs/x_db_type/new_column/mysql/app/migrations_mysql_db/m200000_000003_create_table_pristines.php @@ -19,7 +19,7 @@ public function up() 7 => 'col_9 varchar(9) NULL DEFAULT NULL', 8 => 'col_10 varchar(10) NULL DEFAULT NULL', 9 => 'col_11 text NULL', - 10 => 'price decimal(10,2) NULL DEFAULT 0', + 10 => 'price decimal(10,2) NULL DEFAULT 0 COMMENT \'price in EUR\'', ]); } diff --git a/tests/specs/x_on_x_fk_constraint/app/migrations_pgsql_db/m200000_000001_create_table_postxes.php b/tests/specs/x_on_x_fk_constraint/app/migrations_pgsql_db/m200000_000001_create_table_postxes.php index f0e8adc8..777920de 100644 --- a/tests/specs/x_on_x_fk_constraint/app/migrations_pgsql_db/m200000_000001_create_table_postxes.php +++ b/tests/specs/x_on_x_fk_constraint/app/migrations_pgsql_db/m200000_000001_create_table_postxes.php @@ -10,10 +10,10 @@ public function safeUp() $this->createTable('{{%postxes}}', [ 'id' => $this->primaryKey(), 'title' => $this->text()->null()->defaultValue(null), - 'user_id' => $this->integer()->null()->defaultValue(null), - 'user_2_id' => $this->integer()->null()->defaultValue(null), - 'user_3_id' => $this->integer()->null()->defaultValue(null), - 'user_4_id' => $this->integer()->null()->defaultValue(null), + 'user_id' => $this->integer()->null()->defaultValue(null)->comment('x on-x (update|delete) foreign key constraint'), + 'user_2_id' => $this->integer()->null()->defaultValue(null)->comment('x on-x (update|delete) foreign key constraint'), + 'user_3_id' => $this->integer()->null()->defaultValue(null)->comment('x on-x (update|delete) foreign key constraint'), + 'user_4_id' => $this->integer()->null()->defaultValue(null)->comment('x on-x (update|delete) foreign key constraint'), ]); $this->addForeignKey('fk_postxes_user_id_userxes_id', '{{%postxes}}', 'user_id', '{{%userxes}}', 'id', null, 'CASCADE'); $this->addForeignKey('fk_postxes_user_2_id_userxes_id', '{{%postxes}}', 'user_2_id', '{{%userxes}}', 'id', 'SET NULL', 'CASCADE');