<?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 Version20210910105046 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 std_attributes_values ADD created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', ADD updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', ADD created_date DATETIME NOT NULL COMMENT \'Date and time of the record creation\', ADD updated_date DATETIME NOT NULL COMMENT \'Date and time the record was last updated\'');
$this->addSql('ALTER TABLE std_attributes_values ADD CONSTRAINT FK_5C73E607DE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_attributes_values ADD CONSTRAINT FK_5C73E60716FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('CREATE INDEX IDX_5C73E607DE12AB56 ON std_attributes_values (created_by)');
$this->addSql('CREATE INDEX IDX_5C73E60716FE72E1 ON std_attributes_values (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 std_attributes_values DROP FOREIGN KEY FK_5C73E607DE12AB56');
$this->addSql('ALTER TABLE std_attributes_values DROP FOREIGN KEY FK_5C73E60716FE72E1');
$this->addSql('DROP INDEX IDX_5C73E607DE12AB56 ON std_attributes_values');
$this->addSql('DROP INDEX IDX_5C73E60716FE72E1 ON std_attributes_values');
$this->addSql('ALTER TABLE std_attributes_values DROP created_by, DROP updated_by, DROP created_date, DROP updated_date');
}
}