Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Adjustment] Update down methods of duplicated migrations not to execute if the changes already exist in db #257

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Migrations/Version20201130071338.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public function up(Schema $schema): void

public function down(Schema $schema): void
{
$adjustmentTable = $schema->getTable('sylius_adjustment');
if (!$adjustmentTable->hasColumn('shipment_id')) {
return;
}

$this->addSql('ALTER TABLE sylius_adjustment DROP FOREIGN KEY FK_ACA6E0F27BE036FC');
$this->addSql('DROP INDEX IDX_ACA6E0F27BE036FC ON sylius_adjustment');
$this->addSql('ALTER TABLE sylius_adjustment DROP shipment_id');
Expand Down
5 changes: 5 additions & 0 deletions src/Migrations/Version20201204071301.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public function up(Schema $schema): void

public function down(Schema $schema): void
{
$adjustmentTable = $schema->getTable('sylius_adjustment');
if (!$adjustmentTable->hasColumn('details')) {
return;
}

$this->addSql('ALTER TABLE sylius_adjustment DROP details');
}
}