migrations/Version20231202115824.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;/*** Auto-generated Migration: Please modify to your needs!*/final class Version20231202115824 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 template_types (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, icon VARCHAR(50) NOT NULL, service VARCHAR(150) NOT NULL, editor_template VARCHAR(50) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE templates (id INT AUTO_INCREMENT NOT NULL, template_type_id INT DEFAULT NULL, name VARCHAR(100) NOT NULL, text LONGTEXT NOT NULL, params VARCHAR(255) DEFAULT NULL, is_default TINYINT(1) NOT NULL, INDEX IDX_6F287D8E96F4F7AA (template_type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('ALTER TABLE templates ADD CONSTRAINT FK_6F287D8E96F4F7AA FOREIGN KEY (template_type_id) REFERENCES template_types (id)');}public function down(Schema $schema): void{// this down() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE templates DROP FOREIGN KEY FK_6F287D8E96F4F7AA');$this->addSql('DROP TABLE template_types');$this->addSql('DROP TABLE templates');}}