Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public function up(Schema $schema): void |
||
16 | { |
||
17 | $shortUrls = $schema->getTable('short_urls'); |
||
18 | $this->skipIf($shortUrls->hasColumn(self::IMPORT_SOURCE_COLUMN)); |
||
19 | |||
20 | $shortUrls->addColumn(self::IMPORT_SOURCE_COLUMN, Types::STRING, [ |
||
21 | 'length' => 255, |
||
22 | 'notnull' => false, |
||
23 | ]); |
||
24 | $shortUrls->addColumn('import_original_short_code', Types::STRING, [ |
||
25 | 'length' => 255, |
||
26 | 'notnull' => false, |
||
27 | ]); |
||
28 | |||
29 | $shortUrls->addUniqueIndex( |
||
30 | [self::IMPORT_SOURCE_COLUMN, 'import_original_short_code', 'domain_id'], |
||
31 | 'unique_imports', |
||
32 | ); |
||
45 |