migrations/Version20230621183533.php line 1

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