<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190815171353 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$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');
$this->addSql('ALTER TABLE event ADD CONSTRAINT FK_3BAE0AA7DE12AB56 FOREIGN KEY (created_by) REFERENCES fos_user (id)');
$this->addSql('ALTER TABLE event ADD CONSTRAINT FK_3BAE0AA716FE72E1 FOREIGN KEY (updated_by) REFERENCES fos_user (id)');
$this->addSql('CREATE INDEX IDX_3BAE0AA7DE12AB56 ON event (created_by)');
$this->addSql('CREATE INDEX IDX_3BAE0AA716FE72E1 ON event (updated_by)');
$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');
$this->addSql('ALTER TABLE event_type ADD CONSTRAINT FK_93151B82DE12AB56 FOREIGN KEY (created_by) REFERENCES fos_user (id)');
$this->addSql('ALTER TABLE event_type ADD CONSTRAINT FK_93151B8216FE72E1 FOREIGN KEY (updated_by) REFERENCES fos_user (id)');
$this->addSql('CREATE INDEX IDX_93151B82DE12AB56 ON event_type (created_by)');
$this->addSql('CREATE INDEX IDX_93151B8216FE72E1 ON event_type (updated_by)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE event DROP FOREIGN KEY FK_3BAE0AA7DE12AB56');
$this->addSql('ALTER TABLE event DROP FOREIGN KEY FK_3BAE0AA716FE72E1');
$this->addSql('DROP INDEX IDX_3BAE0AA7DE12AB56 ON event');
$this->addSql('DROP INDEX IDX_3BAE0AA716FE72E1 ON event');
$this->addSql('ALTER TABLE event DROP created_by, DROP updated_by, DROP created_at, DROP updated_at');
$this->addSql('ALTER TABLE event_type DROP FOREIGN KEY FK_93151B82DE12AB56');
$this->addSql('ALTER TABLE event_type DROP FOREIGN KEY FK_93151B8216FE72E1');
$this->addSql('DROP INDEX IDX_93151B82DE12AB56 ON event_type');
$this->addSql('DROP INDEX IDX_93151B8216FE72E1 ON event_type');
$this->addSql('ALTER TABLE event_type DROP created_by, DROP updated_by, DROP created_at, DROP updated_at');
$this->addSql('DROP INDEX log_class_lookup_idx ON ext_log_entries');
$this->addSql('DROP INDEX log_user_lookup_idx ON ext_log_entries');
$this->addSql('DROP INDEX log_version_lookup_idx ON ext_log_entries');
$this->addSql('CREATE INDEX log_class_lookup_idx ON ext_log_entries (object_class(191))');
$this->addSql('CREATE INDEX log_user_lookup_idx ON ext_log_entries (username(191))');
$this->addSql('CREATE INDEX log_version_lookup_idx ON ext_log_entries (object_id, object_class(191), version)');
}
}