feat: update product tenant relations, implement attachments, refactor product attributes, and configure SQLite for testing

This commit is contained in:
2026-07-01 15:05:21 -03:00
parent a79f58d520
commit 52b422c1ca
5 changed files with 15 additions and 7 deletions

View File

@@ -27,7 +27,9 @@ return new class extends Migration
public function down(): void
{
Schema::table('productos', function (Blueprint $table) {
$table->dropForeign(['tenant_codigo']);
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
$table->dropForeign(['tenant_codigo']);
}
$table->dropColumn('tenant_codigo');
});

View File

@@ -45,8 +45,10 @@ return new class extends Migration
public function down(): void
{
Schema::table('tenants', function (Blueprint $table) {
$table->dropForeign(['header_logo_id']);
$table->dropForeign(['footer_logo_id']);
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
$table->dropForeign(['header_logo_id']);
$table->dropForeign(['footer_logo_id']);
}
});
Schema::dropIfExists('attachments');

View File

@@ -43,7 +43,9 @@ return new class extends Migration
});
Schema::table('productos_variantes_values', function (Blueprint $table) {
$table->dropForeign('productos_variantes_definiciones_attribute_id_foreign');
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
$table->dropForeign('productos_variantes_definiciones_attribute_id_foreign');
}
$table->dropUnique('prod_var_def_variant_attr_unique');
});
@@ -71,7 +73,9 @@ return new class extends Migration
public function down(): void
{
Schema::table('productos_variantes_values', function (Blueprint $table) {
$table->dropForeign(['products_attribute_id']);
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
$table->dropForeign(['products_attribute_id']);
}
$table->dropUnique('prod_var_values_variant_product_attr_unique');
});