diff --git a/tests/comparisons/Migration/pgsql/test_snapshot_auto_id_disabled_pgsql.php b/tests/comparisons/Migration/pgsql/test_snapshot_auto_id_disabled_pgsql.php index e30defe8..8bdeaf43 100644 --- a/tests/comparisons/Migration/pgsql/test_snapshot_auto_id_disabled_pgsql.php +++ b/tests/comparisons/Migration/pgsql/test_snapshot_auto_id_disabled_pgsql.php @@ -74,7 +74,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -121,7 +121,7 @@ public function up(): void 'slug', ], [ - 'name' => 'categories_unique_slug', + 'name' => 'categories_slug_unique', 'unique' => true, ] ) @@ -190,7 +190,7 @@ public function up(): void 'product_id', ], [ - 'name' => 'product_category', + 'name' => 'orders_product_category_idx', ] ) ->create(); @@ -267,7 +267,7 @@ public function up(): void 'slug', ], [ - 'name' => 'products_unique_slug', + 'name' => 'products_slug_unique', 'unique' => true, ] ) @@ -276,7 +276,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx_ft', + 'name' => 'products_title_idx', ] ) ->create(); @@ -335,7 +335,7 @@ public function up(): void 'article_id', ], [ - 'name' => 'UNIQUE_TAG2', + 'name' => 'special_tags_article_unique', 'unique' => true, ] ) @@ -396,7 +396,7 @@ public function up(): void [ 'update' => 'NO_ACTION', 'delete' => 'NO_ACTION', - 'constraint' => 'category_article_idx' + 'constraint' => 'articles_category_fk' ] ) ->update(); @@ -415,7 +415,7 @@ public function up(): void [ 'update' => 'CASCADE', 'delete' => 'CASCADE', - 'constraint' => 'product_id_fk' + 'constraint' => 'orders_product_fk' ] ) ->update(); @@ -428,7 +428,7 @@ public function up(): void [ 'update' => 'CASCADE', 'delete' => 'CASCADE', - 'constraint' => 'category_idx' + 'constraint' => 'products_category_fk' ] ) ->update(); diff --git a/tests/comparisons/Migration/pgsql/test_snapshot_not_empty_pgsql.php b/tests/comparisons/Migration/pgsql/test_snapshot_not_empty_pgsql.php index f1155685..52ef1496 100644 --- a/tests/comparisons/Migration/pgsql/test_snapshot_not_empty_pgsql.php +++ b/tests/comparisons/Migration/pgsql/test_snapshot_not_empty_pgsql.php @@ -65,7 +65,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -105,7 +105,7 @@ public function up(): void 'slug', ], [ - 'name' => 'categories_unique_slug', + 'name' => 'categories_slug_unique', 'unique' => true, ] ) @@ -159,7 +159,7 @@ public function up(): void 'product_id', ], [ - 'name' => 'product_category', + 'name' => 'orders_product_category_idx', ] ) ->create(); @@ -222,7 +222,7 @@ public function up(): void 'slug', ], [ - 'name' => 'products_unique_slug', + 'name' => 'products_slug_unique', 'unique' => true, ] ) @@ -231,7 +231,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx_ft', + 'name' => 'products_title_idx', ] ) ->create(); @@ -282,7 +282,7 @@ public function up(): void 'article_id', ], [ - 'name' => 'UNIQUE_TAG2', + 'name' => 'special_tags_article_unique', 'unique' => true, ] ) @@ -336,7 +336,7 @@ public function up(): void [ 'update' => 'NO_ACTION', 'delete' => 'NO_ACTION', - 'constraint' => 'category_article_idx' + 'constraint' => 'articles_category_fk' ] ) ->update(); @@ -355,7 +355,7 @@ public function up(): void [ 'update' => 'CASCADE', 'delete' => 'CASCADE', - 'constraint' => 'product_id_fk' + 'constraint' => 'orders_product_fk' ] ) ->update(); @@ -368,7 +368,7 @@ public function up(): void [ 'update' => 'CASCADE', 'delete' => 'CASCADE', - 'constraint' => 'category_idx' + 'constraint' => 'products_category_fk' ] ) ->update(); diff --git a/tests/comparisons/Migration/pgsql/test_snapshot_plugin_blog_pgsql.php b/tests/comparisons/Migration/pgsql/test_snapshot_plugin_blog_pgsql.php index 93178aa2..2c852ede 100644 --- a/tests/comparisons/Migration/pgsql/test_snapshot_plugin_blog_pgsql.php +++ b/tests/comparisons/Migration/pgsql/test_snapshot_plugin_blog_pgsql.php @@ -65,7 +65,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -105,7 +105,7 @@ public function up(): void 'slug', ], [ - 'name' => 'categories_unique_slug', + 'name' => 'categories_slug_unique', 'unique' => true, ] ) @@ -132,7 +132,7 @@ public function up(): void [ 'update' => 'NO_ACTION', 'delete' => 'NO_ACTION', - 'constraint' => 'category_article_idx' + 'constraint' => 'articles_category_fk' ] ) ->update(); diff --git a/tests/comparisons/Migration/sqlite/test_snapshot_auto_id_disabled_sqlite.php b/tests/comparisons/Migration/sqlite/test_snapshot_auto_id_disabled_sqlite.php index 757472bf..dcff3205 100644 --- a/tests/comparisons/Migration/sqlite/test_snapshot_auto_id_disabled_sqlite.php +++ b/tests/comparisons/Migration/sqlite/test_snapshot_auto_id_disabled_sqlite.php @@ -69,7 +69,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -112,7 +112,7 @@ public function up(): void 'slug', ], [ - 'name' => 'categories_unique_slug', + 'name' => 'categories_slug_unique', 'unique' => true, ] ) @@ -181,7 +181,7 @@ public function up(): void 'product_id', ], [ - 'name' => 'product_category', + 'name' => 'orders_product_category_idx', ] ) ->create(); @@ -254,7 +254,7 @@ public function up(): void 'slug', ], [ - 'name' => 'products_unique_slug', + 'name' => 'products_slug_unique', 'unique' => true, ] ) @@ -263,7 +263,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx_ft', + 'name' => 'products_title_idx', ] ) ->create(); @@ -320,7 +320,7 @@ public function up(): void 'article_id', ], [ - 'name' => 'UNIQUE_TAG2', + 'name' => 'special_tags_article_unique', 'unique' => true, ] ) diff --git a/tests/comparisons/Migration/sqlite/test_snapshot_not_empty_sqlite.php b/tests/comparisons/Migration/sqlite/test_snapshot_not_empty_sqlite.php index e8666b6d..3239bc89 100644 --- a/tests/comparisons/Migration/sqlite/test_snapshot_not_empty_sqlite.php +++ b/tests/comparisons/Migration/sqlite/test_snapshot_not_empty_sqlite.php @@ -60,7 +60,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -96,7 +96,7 @@ public function up(): void 'slug', ], [ - 'name' => 'categories_unique_slug', + 'name' => 'categories_slug_unique', 'unique' => true, ] ) @@ -150,7 +150,7 @@ public function up(): void 'product_id', ], [ - 'name' => 'product_category', + 'name' => 'orders_product_category_idx', ] ) ->create(); @@ -209,7 +209,7 @@ public function up(): void 'slug', ], [ - 'name' => 'products_unique_slug', + 'name' => 'products_slug_unique', 'unique' => true, ] ) @@ -218,7 +218,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx_ft', + 'name' => 'products_title_idx', ] ) ->create(); @@ -267,7 +267,7 @@ public function up(): void 'article_id', ], [ - 'name' => 'UNIQUE_TAG2', + 'name' => 'special_tags_article_unique', 'unique' => true, ] ) diff --git a/tests/comparisons/Migration/sqlite/test_snapshot_plugin_blog_sqlite.php b/tests/comparisons/Migration/sqlite/test_snapshot_plugin_blog_sqlite.php index 7d67ce00..4f8b32db 100644 --- a/tests/comparisons/Migration/sqlite/test_snapshot_plugin_blog_sqlite.php +++ b/tests/comparisons/Migration/sqlite/test_snapshot_plugin_blog_sqlite.php @@ -60,7 +60,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -96,7 +96,7 @@ public function up(): void 'slug', ], [ - 'name' => 'categories_unique_slug', + 'name' => 'categories_slug_unique', 'unique' => true, ] ) diff --git a/tests/comparisons/Migration/test_snapshot_auto_id_disabled.php b/tests/comparisons/Migration/test_snapshot_auto_id_disabled.php index 8ce43855..8e38d5b7 100644 --- a/tests/comparisons/Migration/test_snapshot_auto_id_disabled.php +++ b/tests/comparisons/Migration/test_snapshot_auto_id_disabled.php @@ -74,7 +74,7 @@ public function up(): void 'category_id', ], [ - 'name' => 'category_article_idx', + 'name' => 'articles_category_fk', ] ) ->addIndex( @@ -82,7 +82,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -127,7 +127,7 @@ public function up(): void 'slug', ], [ - 'name' => 'categories_unique_slug', + 'name' => 'categories_slug_unique', 'unique' => true, ] ) @@ -200,7 +200,7 @@ public function up(): void 'product_id', ], [ - 'name' => 'product_category', + 'name' => 'orders_product_category_idx', ] ) ->create(); @@ -267,7 +267,7 @@ public function up(): void 'slug', ], [ - 'name' => 'products_unique_slug', + 'name' => 'products_slug_unique', 'unique' => true, ] ) @@ -286,7 +286,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx_ft', + 'name' => 'products_title_idx', ] ) ->create(); @@ -347,7 +347,7 @@ public function up(): void 'article_id', ], [ - 'name' => 'UNIQUE_TAG2', + 'name' => 'special_tags_article_unique', 'unique' => true, ] ) @@ -405,7 +405,7 @@ public function up(): void [ 'update' => 'NO_ACTION', 'delete' => 'NO_ACTION', - 'constraint' => 'category_article_idx' + 'constraint' => 'articles_category_fk' ] ) ->update(); @@ -424,7 +424,7 @@ public function up(): void [ 'update' => 'CASCADE', 'delete' => 'CASCADE', - 'constraint' => 'product_id_fk' + 'constraint' => 'orders_product_fk' ] ) ->update(); @@ -437,7 +437,7 @@ public function up(): void [ 'update' => 'CASCADE', 'delete' => 'CASCADE', - 'constraint' => 'category_idx' + 'constraint' => 'products_category_fk' ] ) ->update(); diff --git a/tests/comparisons/Migration/test_snapshot_not_empty.php b/tests/comparisons/Migration/test_snapshot_not_empty.php index d931cddc..5667cb30 100644 --- a/tests/comparisons/Migration/test_snapshot_not_empty.php +++ b/tests/comparisons/Migration/test_snapshot_not_empty.php @@ -64,7 +64,7 @@ public function up(): void 'category_id', ], [ - 'name' => 'category_article_idx', + 'name' => 'articles_category_fk', ] ) ->addIndex( @@ -72,7 +72,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -109,7 +109,7 @@ public function up(): void 'slug', ], [ - 'name' => 'categories_unique_slug', + 'name' => 'categories_slug_unique', 'unique' => true, ] ) @@ -165,7 +165,7 @@ public function up(): void 'product_id', ], [ - 'name' => 'product_category', + 'name' => 'orders_product_category_idx', ] ) ->create(); @@ -216,7 +216,7 @@ public function up(): void 'slug', ], [ - 'name' => 'products_unique_slug', + 'name' => 'products_slug_unique', 'unique' => true, ] ) @@ -235,7 +235,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx_ft', + 'name' => 'products_title_idx', ] ) ->create(); @@ -287,7 +287,7 @@ public function up(): void 'article_id', ], [ - 'name' => 'UNIQUE_TAG2', + 'name' => 'special_tags_article_unique', 'unique' => true, ] ) @@ -337,7 +337,7 @@ public function up(): void [ 'update' => 'NO_ACTION', 'delete' => 'NO_ACTION', - 'constraint' => 'category_article_idx' + 'constraint' => 'articles_category_fk' ] ) ->update(); @@ -356,7 +356,7 @@ public function up(): void [ 'update' => 'CASCADE', 'delete' => 'CASCADE', - 'constraint' => 'product_id_fk' + 'constraint' => 'orders_product_fk' ] ) ->update(); @@ -369,7 +369,7 @@ public function up(): void [ 'update' => 'CASCADE', 'delete' => 'CASCADE', - 'constraint' => 'category_idx' + 'constraint' => 'products_category_fk' ] ) ->update(); diff --git a/tests/comparisons/Migration/test_snapshot_plugin_blog.php b/tests/comparisons/Migration/test_snapshot_plugin_blog.php index 2bf089d3..292b033a 100644 --- a/tests/comparisons/Migration/test_snapshot_plugin_blog.php +++ b/tests/comparisons/Migration/test_snapshot_plugin_blog.php @@ -64,7 +64,7 @@ public function up(): void 'category_id', ], [ - 'name' => 'category_article_idx', + 'name' => 'articles_category_fk', ] ) ->addIndex( @@ -72,7 +72,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -109,7 +109,7 @@ public function up(): void 'slug', ], [ - 'name' => 'categories_unique_slug', + 'name' => 'categories_slug_unique', 'unique' => true, ] ) @@ -137,7 +137,7 @@ public function up(): void [ 'update' => 'NO_ACTION', 'delete' => 'NO_ACTION', - 'constraint' => 'category_article_idx' + 'constraint' => 'articles_category_fk' ] ) ->update(); diff --git a/tests/comparisons/Migration/test_snapshot_with_auto_id_compatible_signed_primary_keys.php b/tests/comparisons/Migration/test_snapshot_with_auto_id_compatible_signed_primary_keys.php index b9fb1214..90a31dcb 100644 --- a/tests/comparisons/Migration/test_snapshot_with_auto_id_compatible_signed_primary_keys.php +++ b/tests/comparisons/Migration/test_snapshot_with_auto_id_compatible_signed_primary_keys.php @@ -64,7 +64,7 @@ public function up(): void 'category_id', ], [ - 'name' => 'category_article_idx', + 'name' => 'articles_category_fk', ] ) ->addIndex( @@ -72,7 +72,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -85,7 +85,7 @@ public function up(): void [ 'update' => 'NO_ACTION', 'delete' => 'NO_ACTION', - 'constraint' => 'category_article_idx' + 'constraint' => 'articles_category_fk' ] ) ->update(); diff --git a/tests/comparisons/Migration/test_snapshot_with_auto_id_incompatible_signed_primary_keys.php b/tests/comparisons/Migration/test_snapshot_with_auto_id_incompatible_signed_primary_keys.php index f6898fc9..ff3f3a8f 100644 --- a/tests/comparisons/Migration/test_snapshot_with_auto_id_incompatible_signed_primary_keys.php +++ b/tests/comparisons/Migration/test_snapshot_with_auto_id_incompatible_signed_primary_keys.php @@ -74,7 +74,7 @@ public function up(): void 'category_id', ], [ - 'name' => 'category_article_idx', + 'name' => 'articles_category_fk', ] ) ->addIndex( @@ -82,7 +82,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -95,7 +95,7 @@ public function up(): void [ 'update' => 'NO_ACTION', 'delete' => 'NO_ACTION', - 'constraint' => 'category_article_idx' + 'constraint' => 'articles_category_fk' ] ) ->update(); diff --git a/tests/comparisons/Migration/test_snapshot_with_auto_id_incompatible_unsigned_primary_keys.php b/tests/comparisons/Migration/test_snapshot_with_auto_id_incompatible_unsigned_primary_keys.php index 133a5058..75d7e5eb 100644 --- a/tests/comparisons/Migration/test_snapshot_with_auto_id_incompatible_unsigned_primary_keys.php +++ b/tests/comparisons/Migration/test_snapshot_with_auto_id_incompatible_unsigned_primary_keys.php @@ -74,7 +74,7 @@ public function up(): void 'category_id', ], [ - 'name' => 'category_article_idx', + 'name' => 'articles_category_fk', ] ) ->addIndex( @@ -82,7 +82,7 @@ public function up(): void 'title', ], [ - 'name' => 'title_idx', + 'name' => 'articles_title_idx', ] ) ->create(); @@ -95,7 +95,7 @@ public function up(): void [ 'update' => 'NO_ACTION', 'delete' => 'NO_ACTION', - 'constraint' => 'category_article_idx' + 'constraint' => 'articles_category_fk' ] ) ->update(); diff --git a/tests/schema.php b/tests/schema.php index 81ccd5db..99639467 100644 --- a/tests/schema.php +++ b/tests/schema.php @@ -18,7 +18,7 @@ ], 'constraints' => [ 'primary' => ['type' => 'primary', 'columns' => ['id']], - 'categories_unique_slug' => ['type' => 'unique', 'columns' => ['slug']], + 'categories_slug_unique' => ['type' => 'unique', 'columns' => ['slug']], ], ], [ @@ -32,16 +32,16 @@ 'modified' => ['type' => 'timestamp', 'null' => true, 'default' => null], ], 'indexes' => [ - 'title_idx_ft' => [ + 'products_title_idx' => [ 'type' => 'index', 'columns' => ['title'], ], ], 'constraints' => [ 'primary' => ['type' => 'primary', 'columns' => ['id']], - 'products_unique_slug' => ['type' => 'unique', 'columns' => ['slug']], + 'products_slug_unique' => ['type' => 'unique', 'columns' => ['slug']], 'products_category_unique' => ['type' => 'unique', 'columns' => ['category_id', 'id']], - 'category_idx' => [ + 'products_category_fk' => [ 'type' => 'foreign', 'columns' => ['category_id'], 'references' => ['categories', 'id'], @@ -58,7 +58,7 @@ 'product_id' => ['type' => 'integer', 'unsigned' => true, 'null' => false, 'length' => 11], ], 'indexes' => [ - 'product_category' => [ + 'orders_product_category_idx' => [ 'type' => 'index', 'columns' => ['product_category', 'product_id'], ], @@ -67,7 +67,7 @@ 'primary' => [ 'type' => 'primary', 'columns' => ['id'], ], - 'product_id_fk' => [ + 'orders_product_fk' => [ 'type' => 'foreign', 'columns' => ['product_category', 'product_id'], 'references' => ['products', ['category_id', 'id']], @@ -90,14 +90,14 @@ 'modified' => ['type' => 'timestamp', 'null' => true, 'default' => null], ], 'indexes' => [ - 'title_idx' => [ + 'articles_title_idx' => [ 'type' => 'index', 'columns' => ['title'], ], ], 'constraints' => [ 'primary' => ['type' => 'primary', 'columns' => ['id']], - 'category_article_idx' => [ + 'articles_category_fk' => [ 'type' => 'foreign', 'columns' => ['category_id'], 'references' => ['categories', 'id'], @@ -112,7 +112,7 @@ 'id' => ['type' => 'uuid', 'default' => 'a4950df3-515f-474c-be4c-6a027c1957e7', 'null' => false ], 'name' => ['type' => 'string', 'length' => 10, 'default' => '', 'null' => false], ], - 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id', 'name']]], + 'constraints' => ['primary' => ['type' => 'primary', 'columns' => ['name', 'id']]], ], [ 'table' => 'events', @@ -157,7 +157,7 @@ ], 'constraints' => [ 'primary' => ['type' => 'primary', 'columns' => ['id']], - 'UNIQUE_TAG2' => ['type' => 'unique', 'columns' => ['article_id']], + 'special_tags_article_unique' => ['type' => 'unique', 'columns' => ['article_id']], ], ], [