migrations/Version20200714070604.php line 1

  1. <?php
  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. class Version20200714070604 extends AbstractMigration
  9. {
  10.     /**
  11.      * @param Schema $schema
  12.      */
  13.     public function up(Schema $schema) : void
  14.     {
  15.         // this up() migration is auto-generated, please modify it to your needs
  16.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  17.         $this->addSql('CREATE SEQUENCE seq_page_content_id INCREMENT BY 1 MINVALUE 1 START 1;');
  18.         $this->addSql('CREATE TABLE page_content(
  19.                     id      int4 NOT NULL,
  20.                     alias   varchar(64) NOT NULL,
  21.                     title   varchar(64) NOT NULL,
  22.                     content text NOT NULL,
  23.                     PRIMARY KEY (id));
  24.                     ');
  25.     }
  26.     /**
  27.      * @param Schema $schema
  28.      */
  29.     public function down(Schema $schema) : void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql''Migration can only be executed safely on \'postgresql\'.');
  33.         $this->addSql('DROP SEQUENCE seq_page_content_id');
  34.         $this->addSql('DROP TABLE page_content');
  35.     }
  36. }