<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20231013065731 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE product_detail (id INT AUTO_INCREMENT NOT NULL, type_id INT DEFAULT NULL, image_path VARCHAR(255) NOT NULL, locale VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, brand VARCHAR(255) DEFAULT NULL, ean_code VARCHAR(255) NOT NULL, sku VARCHAR(255) NOT NULL, available_stock VARCHAR(255) NOT NULL, hs_code VARCHAR(255) NOT NULL, product_cost DOUBLE PRECISION NOT NULL, return_rate DOUBLE PRECISION NOT NULL, recommend_retail_price DOUBLE PRECISION NOT NULL, INDEX IDX_4C7A3E37C54C8C93 (type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE product_detail ADD CONSTRAINT FK_4C7A3E37C54C8C93 FOREIGN KEY (type_id) REFERENCES product_type (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE product_detail');
}
}