migrations/Version20230222132506.php line 1

Open in your IDE?
  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 Version20230222132506 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE section_title (id INT AUTO_INCREMENT NOT NULL, tag_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, subtitle LONGTEXT DEFAULT NULL, image VARCHAR(255) DEFAULT NULL, is_active TINYINT(1) NOT NULL, title2 VARCHAR(255) DEFAULT NULL, summary LONGTEXT DEFAULT NULL, title3 VARCHAR(255) DEFAULT NULL, slug VARCHAR(255) DEFAULT NULL, icon VARCHAR(255) DEFAULT NULL, logo VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_BC611F0FBAD26311 (tag_id), INDEX IDX_BC611F0FB03A8386 (created_by_id), INDEX IDX_BC611F0F896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE section_title ADD CONSTRAINT FK_BC611F0FBAD26311 FOREIGN KEY (tag_id) REFERENCES tag (id)');
  20.         $this->addSql('ALTER TABLE section_title ADD CONSTRAINT FK_BC611F0FB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
  21.         $this->addSql('ALTER TABLE section_title ADD CONSTRAINT FK_BC611F0F896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->addSql('ALTER TABLE section_title DROP FOREIGN KEY FK_BC611F0FBAD26311');
  27.         $this->addSql('ALTER TABLE section_title DROP FOREIGN KEY FK_BC611F0FB03A8386');
  28.         $this->addSql('ALTER TABLE section_title DROP FOREIGN KEY FK_BC611F0F896DBBDE');
  29.         $this->addSql('DROP TABLE section_title');
  30.     }
  31. }