| Total Complexity | 3 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 8 | class Migration1536233290CustomFieldSetRelation extends MigrationStep |
||
| 9 | { |
||
| 10 | public function getCreationTimestamp(): int |
||
| 11 | { |
||
| 12 | return 1536233290; |
||
| 13 | } |
||
| 14 | |||
| 15 | public function update(Connection $connection): void |
||
| 16 | { |
||
| 17 | $connection->exec(' |
||
| 18 | CREATE TABLE `custom_field_set_relation` ( |
||
| 19 | `id` BINARY(16) NOT NULL, |
||
| 20 | `set_id` BINARY(16) NOT NULL, |
||
| 21 | `entity_name` VARCHAR(64) NOT NULL, |
||
| 22 | `created_at` DATETIME(3) NOT NULL, |
||
| 23 | `updated_at` DATETIME(3) NULL, |
||
| 24 | PRIMARY KEY(`id`), |
||
| 25 | CONSTRAINT `uniq.custom_field_set_relation.entity_name` |
||
| 26 | UNIQUE (`set_id`, `entity_name`), |
||
| 27 | CONSTRAINT `fk.custom_field_set_relation.set_id` FOREIGN KEY (`set_id`) |
||
| 28 | REFERENCES `custom_field_set` (id) ON UPDATE CASCADE ON DELETE CASCADE |
||
| 29 | ); |
||
| 30 | '); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function updateDestructive(Connection $connection): void |
||
| 34 | { |
||
| 35 | // implement update destructive |
||
| 38 |