<?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 Version20220718141938 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_code (id INT AUTO_INCREMENT NOT NULL, coupon_id INT NOT NULL, account_id INT DEFAULT NULL, code VARCHAR(255) DEFAULT NULL, expires_at DATETIME DEFAULT NULL, first_time_transaction TINYINT(1) NOT NULL, minimal_amount INT DEFAULT NULL, currency VARCHAR(255) DEFAULT NULL, INDEX IDX_C1EFB80766C5951B (coupon_id), INDEX IDX_C1EFB8079B6B5FBA (account_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE promotion_code ADD CONSTRAINT FK_C1EFB80766C5951B FOREIGN KEY (coupon_id) REFERENCES coupon (id)');
$this->addSql('ALTER TABLE promotion_code ADD CONSTRAINT FK_C1EFB8079B6B5FBA FOREIGN KEY (account_id) REFERENCES account (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE promotion_code');
}
}