<?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 Version20221216153528 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 address ADD author_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE address ADD CONSTRAINT FK_D4E6F81F675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_D4E6F81F675F31B ON address (author_id)');
$this->addSql('ALTER TABLE event ADD author_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE event ADD CONSTRAINT FK_3BAE0AA7F675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_3BAE0AA7F675F31B ON event (author_id)');
$this->addSql('ALTER TABLE file ADD author_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610F675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_8C9F3610F675F31B ON file (author_id)');
$this->addSql('ALTER TABLE flag ADD author_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE flag ADD CONSTRAINT FK_D1F4EB9AF675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_D1F4EB9AF675F31B ON flag (author_id)');
$this->addSql('ALTER TABLE open_hours ADD author_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE open_hours ADD CONSTRAINT FK_C1A79D8BF675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_C1A79D8BF675F31B ON open_hours (author_id)');
$this->addSql('ALTER TABLE pictogram ADD author_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE pictogram ADD CONSTRAINT FK_56E0A15FF675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_56E0A15FF675F31B ON pictogram (author_id)');
$this->addSql('ALTER TABLE small_image ADD author_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE small_image ADD CONSTRAINT FK_56D3453CF675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_56D3453CF675F31B ON small_image (author_id)');
$this->addSql('ALTER TABLE tag ADD author_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE tag ADD CONSTRAINT FK_389B783F675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_389B783F675F31B ON tag (author_id)');
$this->addSql('ALTER TABLE visiting_card ADD author_id BIGINT UNSIGNED DEFAULT NULL');
$this->addSql('ALTER TABLE visiting_card ADD CONSTRAINT FK_CB2C96CCF675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_CB2C96CCF675F31B ON visiting_card (author_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE address DROP FOREIGN KEY FK_D4E6F81F675F31B');
$this->addSql('DROP INDEX IDX_D4E6F81F675F31B ON address');
$this->addSql('ALTER TABLE address DROP author_id');
$this->addSql('ALTER TABLE event DROP FOREIGN KEY FK_3BAE0AA7F675F31B');
$this->addSql('DROP INDEX IDX_3BAE0AA7F675F31B ON event');
$this->addSql('ALTER TABLE event DROP author_id');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610F675F31B');
$this->addSql('DROP INDEX IDX_8C9F3610F675F31B ON file');
$this->addSql('ALTER TABLE file DROP author_id');
$this->addSql('ALTER TABLE flag DROP FOREIGN KEY FK_D1F4EB9AF675F31B');
$this->addSql('DROP INDEX IDX_D1F4EB9AF675F31B ON flag');
$this->addSql('ALTER TABLE flag DROP author_id');
$this->addSql('ALTER TABLE open_hours DROP FOREIGN KEY FK_C1A79D8BF675F31B');
$this->addSql('DROP INDEX IDX_C1A79D8BF675F31B ON open_hours');
$this->addSql('ALTER TABLE open_hours DROP author_id');
$this->addSql('ALTER TABLE pictogram DROP FOREIGN KEY FK_56E0A15FF675F31B');
$this->addSql('DROP INDEX IDX_56E0A15FF675F31B ON pictogram');
$this->addSql('ALTER TABLE pictogram DROP author_id');
$this->addSql('ALTER TABLE small_image DROP FOREIGN KEY FK_56D3453CF675F31B');
$this->addSql('DROP INDEX IDX_56D3453CF675F31B ON small_image');
$this->addSql('ALTER TABLE small_image DROP author_id');
$this->addSql('ALTER TABLE tag DROP FOREIGN KEY FK_389B783F675F31B');
$this->addSql('DROP INDEX IDX_389B783F675F31B ON tag');
$this->addSql('ALTER TABLE tag DROP author_id');
$this->addSql('ALTER TABLE visiting_card DROP FOREIGN KEY FK_CB2C96CCF675F31B');
$this->addSql('DROP INDEX IDX_CB2C96CCF675F31B ON visiting_card');
$this->addSql('ALTER TABLE visiting_card DROP author_id');
}
}