Conditions | 1 |
Paths | 1 |
Total Lines | 46 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
20 | public function safeUp() |
||
21 | { |
||
22 | $this->createTable( |
||
23 | ProviderLock::tableName(), |
||
24 | [ |
||
25 | 'providerId' => $this->integer()->notNull(), |
||
26 | 'pluginId' => $this->integer()->notNull(), |
||
27 | 'dateCreated' => $this->dateTime()->notNull(), |
||
28 | 'dateUpdated' => $this->dateTime()->notNull(), |
||
29 | 'uid' => $this->uid(), |
||
30 | ] |
||
31 | ); |
||
32 | |||
33 | $this->addPrimaryKey( |
||
34 | null, |
||
35 | ProviderLock::tableName(), |
||
36 | [ |
||
37 | 'providerId', |
||
38 | 'pluginId' |
||
39 | ] |
||
40 | ); |
||
41 | |||
42 | $this->addForeignKey( |
||
43 | $this->db->getForeignKeyName( |
||
44 | ProviderLock::tableName(), |
||
45 | 'providerId' |
||
46 | ), |
||
47 | ProviderLock::tableName(), |
||
48 | 'providerId', |
||
49 | Provider::tableName(), |
||
50 | 'id', |
||
51 | 'CASCADE' |
||
52 | ); |
||
53 | |||
54 | $this->addForeignKey( |
||
55 | $this->db->getForeignKeyName( |
||
56 | ProviderLock::tableName(), |
||
57 | 'pluginId' |
||
58 | ), |
||
59 | ProviderLock::tableName(), |
||
60 | 'pluginId', |
||
61 | '{{%plugins}}', |
||
62 | 'id', |
||
63 | 'CASCADE' |
||
64 | ); |
||
65 | } |
||
66 | |||
77 |