migrations/Version20190815171353.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 Version20190815171353 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('ALTER TABLE event ADD created_by INT DEFAULT NULL, ADD updated_by INT DEFAULT NULL, ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL');
  20.         $this->addSql('ALTER TABLE event ADD CONSTRAINT FK_3BAE0AA7DE12AB56 FOREIGN KEY (created_by) REFERENCES fos_user (id)');
  21.         $this->addSql('ALTER TABLE event ADD CONSTRAINT FK_3BAE0AA716FE72E1 FOREIGN KEY (updated_by) REFERENCES fos_user (id)');
  22.         $this->addSql('CREATE INDEX IDX_3BAE0AA7DE12AB56 ON event (created_by)');
  23.         $this->addSql('CREATE INDEX IDX_3BAE0AA716FE72E1 ON event (updated_by)');
  24.         $this->addSql('ALTER TABLE event_type ADD created_by INT DEFAULT NULL, ADD updated_by INT DEFAULT NULL, ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL');
  25.         $this->addSql('ALTER TABLE event_type ADD CONSTRAINT FK_93151B82DE12AB56 FOREIGN KEY (created_by) REFERENCES fos_user (id)');
  26.         $this->addSql('ALTER TABLE event_type ADD CONSTRAINT FK_93151B8216FE72E1 FOREIGN KEY (updated_by) REFERENCES fos_user (id)');
  27.         $this->addSql('CREATE INDEX IDX_93151B82DE12AB56 ON event_type (created_by)');
  28.         $this->addSql('CREATE INDEX IDX_93151B8216FE72E1 ON event_type (updated_by)');
  29.     }
  30.     public function down(Schema $schema) : void
  31.     {
  32.         // this down() migration is auto-generated, please modify it to your needs
  33.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  34.         $this->addSql('ALTER TABLE event DROP FOREIGN KEY FK_3BAE0AA7DE12AB56');
  35.         $this->addSql('ALTER TABLE event DROP FOREIGN KEY FK_3BAE0AA716FE72E1');
  36.         $this->addSql('DROP INDEX IDX_3BAE0AA7DE12AB56 ON event');
  37.         $this->addSql('DROP INDEX IDX_3BAE0AA716FE72E1 ON event');
  38.         $this->addSql('ALTER TABLE event DROP created_by, DROP updated_by, DROP created_at, DROP updated_at');
  39.         $this->addSql('ALTER TABLE event_type DROP FOREIGN KEY FK_93151B82DE12AB56');
  40.         $this->addSql('ALTER TABLE event_type DROP FOREIGN KEY FK_93151B8216FE72E1');
  41.         $this->addSql('DROP INDEX IDX_93151B82DE12AB56 ON event_type');
  42.         $this->addSql('DROP INDEX IDX_93151B8216FE72E1 ON event_type');
  43.         $this->addSql('ALTER TABLE event_type DROP created_by, DROP updated_by, DROP created_at, DROP updated_at');
  44.         $this->addSql('DROP INDEX log_class_lookup_idx ON ext_log_entries');
  45.         $this->addSql('DROP INDEX log_user_lookup_idx ON ext_log_entries');
  46.         $this->addSql('DROP INDEX log_version_lookup_idx ON ext_log_entries');
  47.         $this->addSql('CREATE INDEX log_class_lookup_idx ON ext_log_entries (object_class(191))');
  48.         $this->addSql('CREATE INDEX log_user_lookup_idx ON ext_log_entries (username(191))');
  49.         $this->addSql('CREATE INDEX log_version_lookup_idx ON ext_log_entries (object_id, object_class(191), version)');
  50.     }
  51. }