Files
magic-project/database/migrations/2025_11_14_134023_create_access_table.php
T

35 lines
1.2 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Создание таблицы с прописанными параметрами авторизации (ролевая модель приложений)
*/
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('app_roles', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('app_id')->comment('id приложения (связь с таблицей magic_apps)');
$table->text('app_role')->comment('Роль в приложении');
$table->text('role_access')->nullable()->comment('Кому доступна роль (зависит от драйвера в magic_apps)');
$table->foreign('app_id')->references('id')->on('magic_apps');
$table->comment('Ролевая модель приложений');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('app_roles');
}
};