category id not null but product id can be null same with sku id - product photos
This commit is contained in:
@@ -12,7 +12,7 @@ class AllowProductIdToBeNullInProductPhotos extends BaseMigration
|
||||
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
|
||||
* @return void
|
||||
*/
|
||||
public function change(): void
|
||||
public function up(): void
|
||||
{
|
||||
$table = $this->table('product_photos');
|
||||
$table->changeColumn('product_id', 'uuid', [
|
||||
@@ -20,6 +20,34 @@ class AllowProductIdToBeNullInProductPhotos extends BaseMigration
|
||||
'limit' => 11,
|
||||
'null' => true,
|
||||
]);
|
||||
$table->changeColumn('product_category_id', 'uuid', [
|
||||
'default' => null,
|
||||
'limit' => 11,
|
||||
'null' => false,
|
||||
]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 down(): void
|
||||
{
|
||||
$table = $this->table('product_photos');
|
||||
$table->changeColumn('product_id', 'uuid', [
|
||||
'default' => null,
|
||||
'limit' => 11,
|
||||
'null' => false,
|
||||
]);
|
||||
$table->changeColumn('product_category_id', 'uuid', [
|
||||
'default' => null,
|
||||
'limit' => 11,
|
||||
'null' => true,
|
||||
]);
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user