migrations/Version20230621183533.php line 1

  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20230621183533 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $sql = <<<SQL
  18. CREATE TABLE template_extension
  19. (
  20.     id          INT AUTO_INCREMENT NOT NULL,
  21.     template_id INT                NOT NULL,
  22.     `order`     INT DEFAULT 0,
  23.     `type`      VARCHAR(20)        NOT NULL,
  24.     initialized INT DEFAULT 0,
  25.     parameter   VARCHAR(255),
  26.     `value`     VARCHAR(255)       NOT NULL,
  27.     PRIMARY KEY (id),
  28.     INDEX (type),
  29.     FOREIGN KEY (template_id) REFERENCES template (id)
  30. ) DEFAULT CHARACTER SET utf8mb4
  31.   COLLATE `utf8mb4_unicode_ci`
  32.   ENGINE = InnoDB
  33. SQL;
  34.         // this up() migration is auto-generated, please modify it to your needs
  35.         $this->addSql($sql);
  36.     }
  37.     public function down(Schema $schema): void
  38.     {
  39.         $this->addSql('DROP TABLE template_source');
  40.     }
  41. }