| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class CreateRolesTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | $connection = config('roles.connection'); |
||
| 17 | $table = config('roles.rolesTable'); |
||
| 18 | $tableCheck = Schema::connection($connection)->hasTable($table); |
||
| 19 | |||
| 20 | if (!$tableCheck) { |
||
| 21 | Schema::connection($connection)->create($table, function (Blueprint $table) { |
||
| 22 | $table->increments('id')->unsigned(); |
||
| 23 | $table->string('name'); |
||
| 24 | $table->string('slug')->unique(); |
||
| 25 | $table->string('description')->nullable(); |
||
| 26 | $table->integer('level')->default(1); |
||
| 27 | $table->timestamps(); |
||
| 28 | $table->softDeletes(); |
||
| 29 | }); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Reverse the migrations. |
||
| 35 | * |
||
| 36 | * @return void |
||
| 37 | */ |
||
| 38 | public function down() |
||
| 43 | } |
||
| 44 | } |
||
| 45 |