belongs to many external catalogs & catalogs

This commit is contained in:
2025-03-30 22:43:04 -07:00
parent 3a98baae7c
commit b627550dd9
7 changed files with 67 additions and 17 deletions

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
use Migrations\BaseMigration;
class RemoveCatalogIdFromExternalProductCatalogs 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('external_product_catalogs');
$table->removeColumn('product_catalog_id');
$table->removeColumn('enabled');
$table->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
use Migrations\BaseMigration;
class CreateExternalProductCatalogsProductCatalogs 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('external_product_catalogs_product_catalogs');
$table->addColumn('external_product_catalog_id', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
]);
$table->addColumn('product_catalog_id', 'uuid', [
'default' => null,
'null' => false,
]);
$table->addColumn('created', 'datetime', [
'default' => null,
'null' => false,
]);
$table->addColumn('enabled', 'boolean', [
'default' => null,
'null' => false,
]);
$table->create();
}
}