<?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 Version20200728132409 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 orders CHANGE updated_at updated_at DATETIME NOT NULL');
$this->addSql('ALTER TABLE orders RENAME INDEX idx_e52ffdeeebf23851 TO IDX_E52FFDEE4D4CFF2B');
$this->addSql('ALTER TABLE employee ADD CONSTRAINT FK_5D9F75A1A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE employee ADD CONSTRAINT FK_5D9F75A1B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE employee ADD CONSTRAINT FK_5D9F75A1896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
}
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 employee DROP FOREIGN KEY FK_5D9F75A1A76ED395');
$this->addSql('ALTER TABLE employee DROP FOREIGN KEY FK_5D9F75A1B03A8386');
$this->addSql('ALTER TABLE employee DROP FOREIGN KEY FK_5D9F75A1896DBBDE');
$this->addSql('ALTER TABLE orders CHANGE updated_at updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE orders RENAME INDEX idx_e52ffdee4d4cff2b TO IDX_E52FFDEEEBF23851');
}
}