unique rules, allow product id to be null in product photos

This commit is contained in:
2025-11-01 23:16:59 -07:00
parent 2041fc78d3
commit d239a98e8e
4 changed files with 31 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
use Migrations\BaseMigration;
class AllowProductIdToBeNullInProductPhotos 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->changeColumn('product_id', 'uuid', [
'default' => null,
'limit' => 11,
'null' => true,
]);
$table->update();
}
}