<?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 Version20220323151741 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 promotion (id INT AUTO_INCREMENT NOT NULL, shop_id INT DEFAULT NULL, delivery_mode_attr_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, start DATETIME NOT NULL, end DATETIME NOT NULL, type VARCHAR(255) NOT NULL, value INT NOT NULL, free_delivery TINYINT(1) NOT NULL, first_order_only TINYINT(1) NOT NULL, one_time_only TINYINT(1) NOT NULL, minimum_amount INT DEFAULT NULL, active TINYINT(1) NOT NULL, image VARCHAR(255) DEFAULT NULL, visible TINYINT(1) NOT NULL, unique_code VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_C11D7DD14D16C4DD (shop_id), INDEX IDX_C11D7DD13A6F8B44 (delivery_mode_attr_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE promotion ADD CONSTRAINT FK_C11D7DD14D16C4DD FOREIGN KEY (shop_id) REFERENCES shop (id)');
$this->addSql('ALTER TABLE promotion ADD CONSTRAINT FK_C11D7DD13A6F8B44 FOREIGN KEY (delivery_mode_attr_id) REFERENCES delivery_mode_attr (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE promotion');
}
}