ctrlpanel/database/migrations/2023_05_05_090127_role_power.php

39 lines
814 B
PHP
Raw Permalink Normal View History

2023-05-05 09:17:40 +00:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
2023-05-08 09:03:11 +00:00
use Illuminate\Support\Facades\Artisan;
2023-05-05 09:17:40 +00:00
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('roles', function (Blueprint $table) {
$table->integer('power')->after("color")->default(50);
});
2023-05-08 09:03:11 +00:00
Artisan::call('db:seed', [
'--class' => 'PermissionsSeeder',
2023-05-08 09:09:49 +00:00
'--force' => true
2023-05-08 09:03:11 +00:00
]);
2023-05-05 09:17:40 +00:00
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('roles', function (Blueprint $table) {
$table->dropColumn('power');
});
}
};