Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function change() |
||
13 | { |
||
14 | $userRoleTable = $this->table('role_hierarchy', ['signed' => false]); |
||
15 | |||
16 | $userRoleTable->addColumn('parent_role_id', 'integer', ['signed' => false]) |
||
17 | ->addColumn('child_role_id', 'integer', ['signed' => false]) |
||
18 | ->addColumn('created_at', 'datetime') |
||
19 | ->addIndex(['parent_role_id', 'child_role_id'], ['name' => 'idx_role_hierarchy_unique', 'unique' => true]) |
||
20 | ->addForeignKey('parent_role_id', 'role', 'id', ['delete' => 'RESTRICT', 'constraint' => 'fk_role_hierarchy_parent']) |
||
21 | ->addForeignKey('child_role_id', 'role', 'id', ['delete' => 'RESTRICT', 'constraint' => 'fk_role_hierarchy_child']) |
||
22 | ->create(); |
||
23 | } |
||
25 |