migrations/Version20230911150011.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 Version20230911150011 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('alter table module_page add meta_keywords TEXT default NULL');
  18.     }
  19.     public function down(Schema $schema): void
  20.     {
  21.        $this->addSql("create table module_page_dg_tmp
  22. (
  23.     id               INTEGER                                not null
  24.         primary key autoincrement,
  25.     slug             VARCHAR(255)                           not null,
  26.     title            VARCHAR(255)                           not null,
  27.     description      CLOB                                   not null,
  28.     capability_title VARCHAR(255) default NULL,
  29.     capability_text  CLOB         default NULL,
  30.     configure_title  VARCHAR(255) default NULL,
  31.     configure_text   CLOB         default NULL,
  32.     tariffs          CLOB                                   not null,
  33.     feature_text     CLOB         default NULL,
  34.     feature_image    VARCHAR(255) default NULL,
  35.     created_at       DATETIME     default CURRENT_TIMESTAMP not null,
  36.     updated_at       DATETIME     default NULL,
  37.     feature_btn_text VARCHAR(255) default NULL,
  38.     active           BOOLEAN                                not null,
  39.     page_title       VARCHAR(255) default ''                not null,
  40.     meta_description VARCHAR(255) default ''                not null,
  41.     feature_you_tube VARCHAR(255) default NULL,
  42.     pos              INTEGER      default NULL
  43. )
  44. ");
  45.         $this->addSql("
  46. insert into module_page_dg_tmp(id, slug, title, description, capability_title, capability_text, configure_title,
  47.                                configure_text, tariffs, feature_text, feature_image, created_at, updated_at,
  48.                                feature_btn_text, active, page_title, meta_description, feature_you_tube, pos)
  49.             select id, slug, title, description, capability_title, capability_text, configure_title, configure_text,
  50.                    tariffs, feature_text, feature_image, created_at, updated_at, feature_btn_text, active, page_title,
  51.                    meta_description, feature_you_tube, pos
  52.             from module_page
  53.        ");
  54.         $this->addSql("drop table module_page");
  55.         $this->addSql("alter table module_page_dg_tmp rename to module_page");
  56.         $this->addSql("create unique index UNIQ_AE36F32C989D9B62 on module_page (slug)");
  57.     }
  58. }