migrations/Version20200125234132.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 Version20200125234132 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  19.         $this->addSql('CREATE TABLE action_comment (id INT AUTO_INCREMENT NOT NULL, action_id INT NOT NULL, content LONGTEXT NOT NULL, INDEX IDX_4ED6DA8D9D32F035 (action_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE action_comment ADD CONSTRAINT FK_4ED6DA8D9D32F035 FOREIGN KEY (action_id) REFERENCES action (id)');
  21.         $this->addSql('ALTER TABLE resource CHANGE notification_book_ac notification_book_ac TINYINT(1) DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE action ADD assigned_id INT DEFAULT NULL, ADD reminder DATETIME DEFAULT NULL, ADD completed TINYINT(1) DEFAULT NULL');
  23.         $this->addSql('ALTER TABLE action ADD CONSTRAINT FK_47CC8C92E1501A05 FOREIGN KEY (assigned_id) REFERENCES fos_user (id)');
  24.         $this->addSql('CREATE INDEX IDX_47CC8C92E1501A05 ON action (assigned_id)');
  25.     }
  26.     public function down(Schema $schema) : void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  30.         $this->addSql('DROP TABLE action_comment');
  31.         $this->addSql('ALTER TABLE action DROP FOREIGN KEY FK_47CC8C92E1501A05');
  32.         $this->addSql('DROP INDEX IDX_47CC8C92E1501A05 ON action');
  33.         $this->addSql('ALTER TABLE action DROP assigned_id, DROP reminder, DROP completed');
  34.         $this->addSql('ALTER TABLE resource CHANGE notification_book_ac notification_book_ac TINYINT(1) NOT NULL');
  35.     }
  36. }