Conditions | 1 |
Paths | 1 |
Total Lines | 27 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | public function up(): void |
||
11 | { |
||
12 | //Action when migrate up |
||
13 | $this->create('permissions', function (CreateTable $table) { |
||
14 | $table->integer('id') |
||
15 | ->autoincrement() |
||
16 | ->primary(); |
||
17 | |||
18 | $table->string('code') |
||
19 | ->description('The permission code') |
||
20 | ->unique() |
||
21 | ->notNull(); |
||
22 | |||
23 | $table->string('description') |
||
24 | ->description('The permission description') |
||
25 | ->notNull(); |
||
26 | |||
27 | $table->integer('parent_id') |
||
28 | ->description('The parent permission'); |
||
29 | |||
30 | $table->timestamps(); |
||
31 | |||
32 | $table->foreign('parent_id') |
||
33 | ->references('permissions', 'id') |
||
34 | ->onDelete('CASCADE'); |
||
35 | |||
36 | $table->engine('INNODB'); |
||
37 | }); |
||
46 |