<?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 Version20220720151327 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 stat_reservation ADD center_id INT NOT NULL');
$this->addSql('ALTER TABLE stat_reservation ADD CONSTRAINT FK_9A0AB6F85932F377 FOREIGN KEY (center_id) REFERENCES center (id)');
$this->addSql('CREATE INDEX IDX_9A0AB6F85932F377 ON stat_reservation (center_id)');
$this->addSql('ALTER TABLE stat_weight ADD center_id INT NOT NULL');
$this->addSql('ALTER TABLE stat_weight ADD CONSTRAINT FK_F375C7CD5932F377 FOREIGN KEY (center_id) REFERENCES center (id)');
$this->addSql('CREATE INDEX IDX_F375C7CD5932F377 ON stat_weight (center_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE stat_reservation DROP FOREIGN KEY FK_9A0AB6F85932F377');
$this->addSql('DROP INDEX IDX_9A0AB6F85932F377 ON stat_reservation');
$this->addSql('ALTER TABLE stat_reservation DROP center_id');
$this->addSql('ALTER TABLE stat_weight DROP FOREIGN KEY FK_F375C7CD5932F377');
$this->addSql('DROP INDEX IDX_F375C7CD5932F377 ON stat_weight');
$this->addSql('ALTER TABLE stat_weight DROP center_id');
}
}