Skip to content

Commit

Permalink
Merge pull request #4309 from kiy0taka/dev/fix_migration_20190821081036
Browse files Browse the repository at this point in the history
マイグレーション時のエラーを修正
  • Loading branch information
chihiro-adachi committed Sep 5, 2019
2 parents d5d6e10 + 8f763d4 commit 7b267c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/DoctrineMigrations/Version20190821081036.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public function up(Schema $schema) : void
return;
}

$this->addSql("INSERT INTO dtb_csv (id, csv_type_id, creator_id, entity_name, field_name, reference_field_name, disp_name, sort_no, enabled, create_date, update_date, discriminator_type) VALUES (204, 1, null , 'Eccube\\\\Entity\\\\ProductClass', 'TaxRule', 'tax_rate', '税率', 31, false, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP,'csv')");
$taxRateExists = $this->connection->fetchColumn("SELECT COUNT(*) FROM dtb_csv WHERE csv_type_id = 1 AND entity_name = ? AND field_name = 'TaxRule' AND reference_field_name = 'tax_rate'", ['Eccube\\\\Entity\\\\ProductClass']);
if ($taxRateExists == 0) {
$this->addSql("INSERT INTO dtb_csv (csv_type_id, creator_id, entity_name, field_name, reference_field_name, disp_name, sort_no, enabled, create_date, update_date, discriminator_type) VALUES (1, null , ?, 'TaxRule', 'tax_rate', '税率', 31, false, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP,'csv')", ['Eccube\\\\Entity\\\\ProductClass']);
}
}

public function down(Schema $schema) : void
Expand Down

0 comments on commit 7b267c5

Please sign in to comment.