2020-03-23 00:56:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class DropPermissionsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*/
|
2022-11-25 21:29:04 +01:00
|
|
|
public function up(): void
|
2020-03-23 00:56:00 +01:00
|
|
|
{
|
|
|
|
Schema::dropIfExists('permissions');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*/
|
2022-11-25 21:29:04 +01:00
|
|
|
public function down(): void
|
2020-03-23 00:56:00 +01:00
|
|
|
{
|
|
|
|
Schema::create('permissions', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
|
|
|
$table->unsignedInteger('subuser_id');
|
|
|
|
$table->string('permission');
|
|
|
|
|
|
|
|
$table->foreign('subuser_id')->references('id')->on('subusers')->onDelete('cascade');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|