38 lines
858 B
PHP
38 lines
858 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
||
|
class CreatePermissionsTable extends Migration
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('permissions', function (Blueprint $table) {
|
||
|
$table->increments('id');
|
||
|
$table->integer('inherit_id')->unsigned()->nullable()->index();
|
||
|
$table->foreign('inherit_id')->references('id')->on('permissions');
|
||
|
$table->string('name')->index();
|
||
|
$table->string('slug')->index();
|
||
|
$table->text('description')->nullable();
|
||
|
$table->timestamps();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::drop('permissions');
|
||
|
}
|
||
|
|
||
|
}
|