Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
7 | public function safeUp() |
||
8 | { |
||
9 | $this->createTable('{{%user_profile_to_file}}', [ |
||
10 | 'id' => $this->primaryKey(), |
||
11 | 'user_id' => $this->integer()->notNull()->defaultValue(0), |
||
12 | 'file_id' => $this->integer()->notNull()->defaultValue(0), |
||
13 | ], $this->tableOptions); |
||
14 | |||
15 | $this->createIndex('link', '{{%user_profile_to_file}}', 'user_id, file_id'); |
||
16 | |||
17 | $this->addForeignKey( |
||
18 | 'fk_user_profile_to_file__user_id__user_id', |
||
19 | '{{%user_profile_to_file}}', |
||
20 | 'user_id', |
||
21 | '{{%user}}', |
||
22 | 'id', |
||
23 | 'CASCADE', |
||
24 | 'CASCADE' |
||
25 | ); |
||
26 | } |
||
27 | |||
33 |