primary sku photo working with janky toggle workaround but w/e lol

This commit is contained in:
2025-11-01 16:10:48 -07:00
parent 41c5f7169e
commit b145e901ef
9 changed files with 226 additions and 10 deletions

View File

@@ -79,7 +79,7 @@ class CreateProductPhotos extends BaseMigration
'product_sku_id',
], [
'name' => 'PRODUCT_PHOTOS_BY_PRODUCT_SKU_ID',
'unique' => true,
'unique' => false,
]);
$table->create();

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
use Migrations\BaseMigration;
class AddPrimarySkuPhotoToProductPhotos extends BaseMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* @return void
*/
public function change(): void
{
$table = $this->table('product_photos');
$table->addColumn('primary_sku_photo', 'boolean', [
'default' => false,
'limit' => 11,
'null' => false,
]);
$table->update();
}
}