<?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 Version20220810133321 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 addon (id INT AUTO_INCREMENT NOT NULL, tax_id INT DEFAULT NULL, is_enabled TINYINT(1) DEFAULT NULL, is_one_time TINYINT(1) DEFAULT NULL, is_system TINYINT(1) DEFAULT NULL, price NUMERIC(10, 2) NOT NULL, image_path VARCHAR(255) DEFAULT NULL, INDEX IDX_D185917FB2A824D8 (tax_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE addon_translation (id INT AUTO_INCREMENT NOT NULL, addon_id INT NOT NULL, lang VARCHAR(4) NOT NULL, name VARCHAR(255) DEFAULT NULL, short_description LONGTEXT DEFAULT NULL, description LONGTEXT DEFAULT NULL, INDEX IDX_A7C350BFCC642678 (addon_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE tax (id INT AUTO_INCREMENT NOT NULL, value NUMERIC(10, 2) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE tax_translation (id INT AUTO_INCREMENT NOT NULL, tax_id INT NOT NULL, lang VARCHAR(4) NOT NULL, name VARCHAR(255) DEFAULT NULL, INDEX IDX_3BD74C60B2A824D8 (tax_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE addon ADD CONSTRAINT FK_D185917FB2A824D8 FOREIGN KEY (tax_id) REFERENCES tax (id)');
$this->addSql('ALTER TABLE addon_translation ADD CONSTRAINT FK_A7C350BFCC642678 FOREIGN KEY (addon_id) REFERENCES addon (id)');
$this->addSql('ALTER TABLE tax_translation ADD CONSTRAINT FK_3BD74C60B2A824D8 FOREIGN KEY (tax_id) REFERENCES tax (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE addon_translation DROP FOREIGN KEY FK_A7C350BFCC642678');
$this->addSql('ALTER TABLE addon DROP FOREIGN KEY FK_D185917FB2A824D8');
$this->addSql('ALTER TABLE tax_translation DROP FOREIGN KEY FK_3BD74C60B2A824D8');
$this->addSql('DROP TABLE addon');
$this->addSql('DROP TABLE addon_translation');
$this->addSql('DROP TABLE tax');
$this->addSql('DROP TABLE tax_translation');
}
}