Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
22 | public function change(): void |
||
23 | { |
||
24 | $table = $this->table('media-records'); |
||
25 | |||
26 | $table->addColumn('model', 'string'); |
||
27 | $table->addColumn('model_id', 'biginteger'); |
||
28 | $table->addColumn('collection_name', 'string'); |
||
29 | |||
30 | $table->addColumn('file_name', 'string'); |
||
31 | $table->addColumn('path', 'string'); |
||
32 | $table->addColumn('disk', 'string'); |
||
33 | |||
34 | $table->addIndex(['model']); |
||
35 | $table->addIndex(['model_id']); |
||
36 | $table->addIndex(['collection_name']); |
||
37 | |||
38 | $table->addIndex(['model', 'model_id', 'collection_name', 'path'], ['unique' => true]); |
||
39 | |||
40 | $table->save(); |
||
41 | |||
42 | $table->changeColumn('id', 'biginteger', ['identity' => true]); |
||
43 | $table->save(); |
||
44 | } |
||
46 |