Test Setup Failed
Push — master ( a3a234...e290ee )
by Gerhard
15:04 queued 07:19
created

Version20210325143148::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
namespace DoctrineMigrations;
4
5
use Doctrine\DBAL\Schema\Schema;
6
use Doctrine\Migrations\AbstractMigration;
7
8
/**
9
 * Auto-generated Migration: Please modify to your needs!
10
 */
11 View Code Duplication
final class Version20210325143148 extends AbstractMigration
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    public function up(Schema $schema) : void
14
    {
15
        // this up() migration is auto-generated, please modify it to your needs
16
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
17
18
        $this->addSql('ALTER TABLE sylius_product_variant_option_value ADD CONSTRAINT FK_76CDAFA1D957CA06 FOREIGN KEY (option_value_id) REFERENCES shop_product_option_value (id) ON DELETE CASCADE');
19
        $this->addSql('ALTER TABLE shop_product_option_value ADD CONSTRAINT FK_4AC5CB0AA7C41D6F FOREIGN KEY (option_id) REFERENCES shop_product_option (id) ON DELETE CASCADE');
20
        $this->addSql('ALTER TABLE sylius_product_option_value_translation ADD CONSTRAINT FK_8D4382DC2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES shop_product_option_value (id) ON DELETE CASCADE');
21
    }
22
23
    public function down(Schema $schema) : void
24
    {
25
        // this down() migration is auto-generated, please modify it to your needs
26
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
27
28
        $this->addSql('ALTER TABLE shop_product_option_value DROP FOREIGN KEY FK_4AC5CB0AA7C41D6F');
29
        $this->addSql('ALTER TABLE sylius_product_option_value_translation DROP FOREIGN KEY FK_8D4382DC2C2AC5D3');
30
        $this->addSql('ALTER TABLE sylius_product_variant_option_value DROP FOREIGN KEY FK_76CDAFA1D957CA06');
31
    }
32
}
33