<?php
							 | 
						|
								
							 | 
						|
								use Illuminate\Database\Migrations\Migration;
							 | 
						|
								use Illuminate\Database\Schema\Blueprint;
							 | 
						|
								use Illuminate\Support\Facades\Schema;
							 | 
						|
								
							 | 
						|
								class CreateRolesTable extends Migration
							 | 
						|
								{
							 | 
						|
								    /**
							 | 
						|
								     * Run the migrations.
							 | 
						|
								     *
							 | 
						|
								     * @return void
							 | 
						|
								     */
							 | 
						|
								    public function up()
							 | 
						|
								    {
							 | 
						|
								        Schema::create('roles', function (Blueprint $table)
							 | 
						|
								        {
							 | 
						|
								            // Primary key.
							 | 
						|
								            $table->uuid('id')->primary();
							 | 
						|
								
							 | 
						|
								            $table->string('name');
							 | 
						|
								
							 | 
						|
								            // Foreign key for user
							 | 
						|
								            $table->uuid('hub_id');
							 | 
						|
								
							 | 
						|
								            $table->boolean('can_hub_delete')->default(false);
							 | 
						|
								            $table->boolean('can_hub_edit')->default(false);
							 | 
						|
								
							 | 
						|
								            $table->boolean('can_user_add')->default(false);
							 | 
						|
								            $table->boolean('can_user_remove')->default(false);
							 | 
						|
								            $table->boolean('can_user_edit')->default(false);
							 | 
						|
								
							 | 
						|
								            $table->boolean('can_file_delete')->default(false);
							 | 
						|
								            $table->boolean('can_file_upload')->default(false);
							 | 
						|
								            $table->boolean('can_file_download')->default(false);
							 | 
						|
								            $table->boolean('can_file_edit')->default(false);
							 | 
						|
								
							 | 
						|
								            $table->foreign('hub_id')->references('id')->on('hubs');
							 | 
						|
								        });
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    /**
							 | 
						|
								     * Reverse the migrations.
							 | 
						|
								     *
							 | 
						|
								     * @return void
							 | 
						|
								     */
							 | 
						|
								    public function down()
							 | 
						|
								    {
							 | 
						|
								        Schema::dropIfExists('roles');
							 | 
						|
								    }
							 | 
						|
								}
							 |