Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function change() |
||
15 | { |
||
16 | $userRoleTable = $this->table('user_role', ['signed' => false]); |
||
17 | |||
18 | $userRoleTable->addColumn('user_id', 'integer', ['signed' => false]) |
||
19 | ->addColumn('role_id', 'integer', ['signed' => false]) |
||
20 | ->addColumn('created_at', 'datetime') |
||
21 | ->addIndex(['user_id', 'role_id'], ['name' => 'idx_user_role_unique', 'unique' => true]) |
||
22 | ->addForeignKey('role_id', 'role', 'id', ['delete' => 'RESTRICT', 'constraint' => 'fk_user_role_role']) |
||
23 | ->create(); |
||
24 | } |
||
26 |