Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public function up(Schema $schema): void |
||
12 | { |
||
13 | $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
||
14 | |||
15 | $this->addSql('ALTER TABLE order_line CHANGE type type ENUM(\'paper\', \'digital\') NOT NULL COMMENT \'(DC2Type:ProductType)\''); |
||
16 | $this->addSql('ALTER TABLE product ADD type ENUM(\'paper\', \'digital\') NOT NULL COMMENT \'(DC2Type:ProductType)\''); |
||
17 | $this->addSql('ALTER TABLE user_product CHANGE type type ENUM(\'paper\', \'digital\') NOT NULL COMMENT \'(DC2Type:ProductType)\''); |
||
18 | $this->addSql('DROP TABLE user_product'); |
||
19 | $this->addSql('ALTER TABLE subscription CHANGE type type ENUM(\'paper\', \'digital\', \'both\') NOT NULL COMMENT \'(DC2Type:ProductType)\''); |
||
20 | $this->addSql('ALTER TABLE user ADD subscription_last_number_id INT DEFAULT NULL, ADD subscription_begin DATETIME DEFAULT NULL, ADD subscription_type ENUM(\'paper\', \'digital\', \'both\') DEFAULT NULL COMMENT \'(DC2Type:ProductType)\', CHANGE restrict_renew_visibility web_temporary_access TINYINT(1) DEFAULT \'0\' NOT NULL'); |
||
21 | $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649D6F2FD2 FOREIGN KEY (subscription_last_number_id) REFERENCES product (id) ON DELETE SET NULL'); |
||
22 | $this->addSql('CREATE INDEX IDX_8D93D649D6F2FD2 ON user (subscription_last_number_id)'); |
||
23 | } |
||
25 |