<?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 Version20220817073140 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->addSql('ALTER TABLE company ADD created_user_id INT DEFAULT NULL, ADD changed_user_id INT DEFAULT NULL, ADD created DATETIME NOT NULL, ADD changed DATETIME NOT NULL, ADD ip VARCHAR(50) NOT NULL');
$this->addSql('ALTER TABLE company ADD CONSTRAINT FK_4FBF094FE104C1D3 FOREIGN KEY (created_user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE company ADD CONSTRAINT FK_4FBF094FD0B87009 FOREIGN KEY (changed_user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_4FBF094FE104C1D3 ON company (created_user_id)');
$this->addSql('CREATE INDEX IDX_4FBF094FD0B87009 ON company (changed_user_id)');
$this->addSql('ALTER TABLE `order` ADD created_user_id INT DEFAULT NULL, ADD changed_user_id INT DEFAULT NULL, ADD created DATETIME NOT NULL, ADD changed DATETIME NOT NULL, ADD ip VARCHAR(50) NOT NULL');
$this->addSql('ALTER TABLE `order` ADD CONSTRAINT FK_F5299398E104C1D3 FOREIGN KEY (created_user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE `order` ADD CONSTRAINT FK_F5299398D0B87009 FOREIGN KEY (changed_user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_F5299398E104C1D3 ON `order` (created_user_id)');
$this->addSql('CREATE INDEX IDX_F5299398D0B87009 ON `order` (changed_user_id)');
$this->addSql('ALTER TABLE product ADD created_user_id INT DEFAULT NULL, ADD changed_user_id INT DEFAULT NULL, ADD created DATETIME NOT NULL, ADD changed DATETIME NOT NULL, ADD ip VARCHAR(50) NOT NULL');
$this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04ADE104C1D3 FOREIGN KEY (created_user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04ADD0B87009 FOREIGN KEY (changed_user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_D34A04ADE104C1D3 ON product (created_user_id)');
$this->addSql('CREATE INDEX IDX_D34A04ADD0B87009 ON product (changed_user_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE company DROP FOREIGN KEY FK_4FBF094FE104C1D3');
$this->addSql('ALTER TABLE company DROP FOREIGN KEY FK_4FBF094FD0B87009');
$this->addSql('DROP INDEX IDX_4FBF094FE104C1D3 ON company');
$this->addSql('DROP INDEX IDX_4FBF094FD0B87009 ON company');
$this->addSql('ALTER TABLE company DROP created_user_id, DROP changed_user_id, DROP created, DROP changed, DROP ip');
$this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398E104C1D3');
$this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398D0B87009');
$this->addSql('DROP INDEX IDX_F5299398E104C1D3 ON `order`');
$this->addSql('DROP INDEX IDX_F5299398D0B87009 ON `order`');
$this->addSql('ALTER TABLE `order` DROP created_user_id, DROP changed_user_id, DROP created, DROP changed, DROP ip');
$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADE104C1D3');
$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADD0B87009');
$this->addSql('DROP INDEX IDX_D34A04ADE104C1D3 ON product');
$this->addSql('DROP INDEX IDX_D34A04ADD0B87009 ON product');
$this->addSql('ALTER TABLE product DROP created_user_id, DROP changed_user_id, DROP created, DROP changed, DROP ip');
}
}