|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?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 Version20210603142706 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 page ADD CONSTRAINT FK_140AB6206796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
- $this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620D823E37A FOREIGN KEY (section_id) REFERENCES section (id)');
- $this->addSql('CREATE INDEX IDX_140AB6206796D554 ON page (merchant_id)');
- $this->addSql('CREATE INDEX IDX_140AB620D823E37A ON page (section_id)');
- $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6496796D554');
- $this->addSql('DROP INDEX IDX_8D93D6496796D554 ON user');
- $this->addSql('ALTER TABLE user CHANGE merchant_id favorite_merchant_id INT DEFAULT NULL');
- $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649A4849017 FOREIGN KEY (favorite_merchant_id) REFERENCES merchant (id)');
- $this->addSql('CREATE INDEX IDX_8D93D649A4849017 ON user (favorite_merchant_id)');
- $this->addSql('ALTER TABLE user_merchant ADD current_admin_section_id INT DEFAULT NULL');
- $this->addSql('ALTER TABLE user_merchant ADD CONSTRAINT FK_9426C1E1FE54D809 FOREIGN KEY (current_admin_section_id) REFERENCES section (id)');
- $this->addSql('CREATE INDEX IDX_9426C1E1FE54D809 ON user_merchant (current_admin_section_id)');
- }
-
- public function down(Schema $schema): void
- {
- // this down() migration is auto-generated, please modify it to your needs
- $this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6206796D554');
- $this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620D823E37A');
- $this->addSql('DROP INDEX IDX_140AB6206796D554 ON page');
- $this->addSql('DROP INDEX IDX_140AB620D823E37A ON page');
- $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649A4849017');
- $this->addSql('DROP INDEX IDX_8D93D649A4849017 ON user');
- $this->addSql('ALTER TABLE user CHANGE favorite_merchant_id merchant_id INT DEFAULT NULL');
- $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D6496796D554 FOREIGN KEY (merchant_id) REFERENCES merchant (id)');
- $this->addSql('CREATE INDEX IDX_8D93D6496796D554 ON user (merchant_id)');
- $this->addSql('ALTER TABLE user_merchant DROP FOREIGN KEY FK_9426C1E1FE54D809');
- $this->addSql('DROP INDEX IDX_9426C1E1FE54D809 ON user_merchant');
- $this->addSql('ALTER TABLE user_merchant DROP current_admin_section_id');
- }
- }
|