migrations/2019/10/Version20191010072618.php line 1

  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20191010072618 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
  11.         $this->addSql('CREATE TABLE document_dropbox_cursor (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', processed_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', db_cursor LONGTEXT NOT NULL, INDEX processed_at_idx (processed_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
  12.         $this->addSql('ALTER TABLE document DROP INDEX UNIQ_D8698A76727ACA70, ADD INDEX IDX_D8698A76727ACA70 (parent_id)');
  13.     }
  14.     public function down(Schema $schema): void
  15.     {
  16.         $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
  17.         $this->addSql('DROP TABLE document_dropbox_cursor');
  18.         $this->addSql('ALTER TABLE document DROP INDEX IDX_D8698A76727ACA70, ADD UNIQUE INDEX UNIQ_D8698A76727ACA70 (parent_id)');
  19.     }
  20. }