CakeProducts/config/Migrations/20250408080349_AddSoftDelet...

60 lines
1.6 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
use Migrations\BaseMigration;
class AddSoftDeleteToAllTables 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('products');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_category_attributes');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_category_attribute_options');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_categories');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('product_catalogs');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
$table = $this->table('external_product_catalogs_product_catalogs');
$table->addColumn('deleted', 'datetime', [
'default' => null,
'null' => true,
]);
$table->update();
}
}