Skip to content

Commit

Permalink
Use better/unified index/constraint names.
Browse files Browse the repository at this point in the history
This should help to make identifying problems easier, as it's clear
whether the name denotes an index or a foreign key, and to
which tables they belong.
  • Loading branch information
ndm2 committed Sep 14, 2023
1 parent 9422ed1 commit 5edac5f
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx',
'name' => 'articles_title_idx',
]
)
->create();
Expand Down Expand Up @@ -121,7 +121,7 @@ public function up(): void
'slug',
],
[
'name' => 'categories_unique_slug',
'name' => 'categories_slug_unique',
'unique' => true,
]
)
Expand Down Expand Up @@ -190,7 +190,7 @@ public function up(): void
'product_id',
],
[
'name' => 'product_category',
'name' => 'orders_product_category_idx',
]
)
->create();
Expand Down Expand Up @@ -267,7 +267,7 @@ public function up(): void
'slug',
],
[
'name' => 'products_unique_slug',
'name' => 'products_slug_unique',
'unique' => true,
]
)
Expand All @@ -276,7 +276,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx_ft',
'name' => 'products_title_idx',
]
)
->create();
Expand Down Expand Up @@ -335,7 +335,7 @@ public function up(): void
'article_id',
],
[
'name' => 'UNIQUE_TAG2',
'name' => 'special_tags_article_unique',
'unique' => true,
]
)
Expand Down Expand Up @@ -396,7 +396,7 @@ public function up(): void
[
'update' => 'NO_ACTION',
'delete' => 'NO_ACTION',
'constraint' => 'category_article_idx'
'constraint' => 'articles_category_fk'
]
)
->update();
Expand All @@ -415,7 +415,7 @@ public function up(): void
[
'update' => 'CASCADE',
'delete' => 'CASCADE',
'constraint' => 'product_id_fk'
'constraint' => 'orders_product_fk'
]
)
->update();
Expand All @@ -428,7 +428,7 @@ public function up(): void
[
'update' => 'CASCADE',
'delete' => 'CASCADE',
'constraint' => 'category_idx'
'constraint' => 'products_category_fk'
]
)
->update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx',
'name' => 'articles_title_idx',
]
)
->create();
Expand Down Expand Up @@ -105,7 +105,7 @@ public function up(): void
'slug',
],
[
'name' => 'categories_unique_slug',
'name' => 'categories_slug_unique',
'unique' => true,
]
)
Expand Down Expand Up @@ -159,7 +159,7 @@ public function up(): void
'product_id',
],
[
'name' => 'product_category',
'name' => 'orders_product_category_idx',
]
)
->create();
Expand Down Expand Up @@ -222,7 +222,7 @@ public function up(): void
'slug',
],
[
'name' => 'products_unique_slug',
'name' => 'products_slug_unique',
'unique' => true,
]
)
Expand All @@ -231,7 +231,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx_ft',
'name' => 'products_title_idx',
]
)
->create();
Expand Down Expand Up @@ -282,7 +282,7 @@ public function up(): void
'article_id',
],
[
'name' => 'UNIQUE_TAG2',
'name' => 'special_tags_article_unique',
'unique' => true,
]
)
Expand Down Expand Up @@ -336,7 +336,7 @@ public function up(): void
[
'update' => 'NO_ACTION',
'delete' => 'NO_ACTION',
'constraint' => 'category_article_idx'
'constraint' => 'articles_category_fk'
]
)
->update();
Expand All @@ -355,7 +355,7 @@ public function up(): void
[
'update' => 'CASCADE',
'delete' => 'CASCADE',
'constraint' => 'product_id_fk'
'constraint' => 'orders_product_fk'
]
)
->update();
Expand All @@ -368,7 +368,7 @@ public function up(): void
[
'update' => 'CASCADE',
'delete' => 'CASCADE',
'constraint' => 'category_idx'
'constraint' => 'products_category_fk'
]
)
->update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx',
'name' => 'articles_title_idx',
]
)
->create();
Expand Down Expand Up @@ -105,7 +105,7 @@ public function up(): void
'slug',
],
[
'name' => 'categories_unique_slug',
'name' => 'categories_slug_unique',
'unique' => true,
]
)
Expand All @@ -132,7 +132,7 @@ public function up(): void
[
'update' => 'NO_ACTION',
'delete' => 'NO_ACTION',
'constraint' => 'category_article_idx'
'constraint' => 'articles_category_fk'
]
)
->update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx',
'name' => 'articles_title_idx',
]
)
->create();
Expand Down Expand Up @@ -112,7 +112,7 @@ public function up(): void
'slug',
],
[
'name' => 'categories_unique_slug',
'name' => 'categories_slug_unique',
'unique' => true,
]
)
Expand Down Expand Up @@ -181,7 +181,7 @@ public function up(): void
'product_id',
],
[
'name' => 'product_category',
'name' => 'orders_product_category_idx',
]
)
->create();
Expand Down Expand Up @@ -254,7 +254,7 @@ public function up(): void
'slug',
],
[
'name' => 'products_unique_slug',
'name' => 'products_slug_unique',
'unique' => true,
]
)
Expand All @@ -263,7 +263,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx_ft',
'name' => 'products_title_idx',
]
)
->create();
Expand Down Expand Up @@ -320,7 +320,7 @@ public function up(): void
'article_id',
],
[
'name' => 'UNIQUE_TAG2',
'name' => 'special_tags_article_unique',
'unique' => true,
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx',
'name' => 'articles_title_idx',
]
)
->create();
Expand Down Expand Up @@ -96,7 +96,7 @@ public function up(): void
'slug',
],
[
'name' => 'categories_unique_slug',
'name' => 'categories_slug_unique',
'unique' => true,
]
)
Expand Down Expand Up @@ -150,7 +150,7 @@ public function up(): void
'product_id',
],
[
'name' => 'product_category',
'name' => 'orders_product_category_idx',
]
)
->create();
Expand Down Expand Up @@ -209,7 +209,7 @@ public function up(): void
'slug',
],
[
'name' => 'products_unique_slug',
'name' => 'products_slug_unique',
'unique' => true,
]
)
Expand All @@ -218,7 +218,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx_ft',
'name' => 'products_title_idx',
]
)
->create();
Expand Down Expand Up @@ -267,7 +267,7 @@ public function up(): void
'article_id',
],
[
'name' => 'UNIQUE_TAG2',
'name' => 'special_tags_article_unique',
'unique' => true,
]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function up(): void
'title',
],
[
'name' => 'title_idx',
'name' => 'articles_title_idx',
]
)
->create();
Expand Down Expand Up @@ -96,7 +96,7 @@ public function up(): void
'slug',
],
[
'name' => 'categories_unique_slug',
'name' => 'categories_slug_unique',
'unique' => true,
]
)
Expand Down
Loading

0 comments on commit 5edac5f

Please sign in to comment.