From 81a9f827db2a7798b9064806b7752811d97159f8 Mon Sep 17 00:00:00 2001 From: Brandon Shipley Date: Sun, 5 Oct 2025 17:42:07 -0700 Subject: [PATCH] not sure if that index should be kept or if leave up to user to use soft delete - soft delete can break if readd product with same name/category after deleting --- .../Migrations/20241114090547_CreateProducts.php | 14 +++++++------- src/Model/Entity/Product.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/Migrations/20241114090547_CreateProducts.php b/config/Migrations/20241114090547_CreateProducts.php index f7c6833..b680fb2 100644 --- a/config/Migrations/20241114090547_CreateProducts.php +++ b/config/Migrations/20241114090547_CreateProducts.php @@ -35,13 +35,13 @@ class CreateProducts extends AbstractMigration ]); $table->addIndex('product_category_id'); $table->addIndex('product_type_id'); - $table->addIndex([ - 'product_category_id', - 'name', - ], [ - 'name' => 'BY_NAME_AND_CATEGORY_ID', - 'unique' => true, - ]); +// $table->addIndex([ +// 'product_category_id', +// 'name', +// ], [ +// 'name' => 'BY_NAME_AND_CATEGORY_ID', +// 'unique' => true, +// ]); $table->create(); } } diff --git a/src/Model/Entity/Product.php b/src/Model/Entity/Product.php index ec283e7..b9a5b8d 100644 --- a/src/Model/Entity/Product.php +++ b/src/Model/Entity/Product.php @@ -41,6 +41,6 @@ class Product extends Entity // entities 'product_category' => false, 'product_attributes' => true, - 'product_category_variants' => false, + 'product_category_variants' => true, ]; }