| Total Complexity | 2 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class AddPermissionsTable20210717094547 extends AbstractMigration |
||
| 8 | { |
||
| 9 | |||
| 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 | $table->string('code') |
||
| 18 | ->description('The permission code') |
||
| 19 | ->unique() |
||
| 20 | ->notNull(); |
||
| 21 | $table->string('description') |
||
| 22 | ->description('The permission description'); |
||
| 23 | $table->string('depend') |
||
| 24 | ->description('The permission dependency'); |
||
| 25 | $table->datetime('created_at') |
||
| 26 | ->description('permission created at') |
||
| 27 | ->notNull(); |
||
| 28 | $table->datetime('updated_at') |
||
| 29 | ->description('permission updated at'); |
||
| 30 | |||
| 31 | $table->engine('INNODB'); |
||
| 32 | }); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function down(): void |
||
| 39 | } |
||
| 40 | } |