Files
CKB/database/migrations/2023_08_11_140957_create_privileges_table.php
2025-05-27 19:09:17 +07:00

40 lines
956 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePrivilegesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('privileges', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->bigInteger('role_id')->unsigned();
$table->foreign('role_id')->references('id')->on('roles');
$table->tinyInteger('create');
$table->tinyInteger('update');
$table->tinyInteger('delete');
$table->tinyInteger('view');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('privileges');
}
}