42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Migrations\BaseMigration;
|
|
|
|
class CreateProductAttributes 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_attributes', ['id' => false, 'primary_key' => ['id']]);
|
|
$table->addColumn('id', 'uuid', [
|
|
'default' => null,
|
|
'null' => false,
|
|
]);
|
|
$table->addColumn('product_id', 'uuid', [
|
|
'default' => null,
|
|
'null' => false,
|
|
]);
|
|
$table->addColumn('product_category_attribute_id', 'uuid', [
|
|
'default' => null,
|
|
'null' => false,
|
|
]);
|
|
$table->addColumn('attribute_value', 'string', [
|
|
'default' => null,
|
|
'limit' => 255,
|
|
'null' => true,
|
|
]);
|
|
$table->addColumn('product_category_attribute_option_id', 'uuid', [
|
|
'default' => null,
|
|
'null' => true,
|
|
]);
|
|
$table->create();
|
|
}
|
|
}
|