feat: refactor product detail retrieval to simplify variant handling and enhance response structure
This commit is contained in:
@@ -38,6 +38,10 @@ return new class extends Migration
|
||||
});
|
||||
|
||||
// 4. Point variant values to the product-attribute pivot instead of the base attribute
|
||||
Schema::table('productos_variantes_values', function (Blueprint $table) {
|
||||
$table->index('producto_variante_id', 'prod_var_values_variant_id_index');
|
||||
});
|
||||
|
||||
Schema::table('productos_variantes_values', function (Blueprint $table) {
|
||||
$table->dropForeign('productos_variantes_definiciones_attribute_id_foreign');
|
||||
$table->dropUnique('prod_var_def_variant_attr_unique');
|
||||
@@ -85,6 +89,10 @@ return new class extends Migration
|
||||
$table->unique(['producto_variante_id', 'attribute_id'], 'prod_var_def_variant_attr_unique');
|
||||
});
|
||||
|
||||
Schema::table('productos_variantes_values', function (Blueprint $table) {
|
||||
$table->dropIndex('prod_var_values_variant_id_index');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('products_attributes');
|
||||
Schema::rename('productos_variantes_values', 'productos_variantes_definiciones');
|
||||
Schema::rename('attribute', 'productos_attributes');
|
||||
|
||||
Reference in New Issue
Block a user