adds roles

This commit is contained in:
2026-02-16 11:19:06 +01:00
parent ebaeb1722d
commit 4dc64c22cb
29 changed files with 495 additions and 89 deletions

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('roles', function (Blueprint $table) {
$table->id();
$table->string('name')->unique();
$table->timestamps();
});
$now = now();
DB::table('roles')->insert([
['name' => 'user', 'created_at' => $now, 'updated_at' => $now],
['name' => 'admin', 'created_at' => $now, 'updated_at' => $now],
]);
}
public function down(): void
{
Schema::dropIfExists('roles');
}
};

View File

@@ -13,10 +13,16 @@ public function up(): void
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->foreignId('role_id')->default(1)->constrained();
$table->string('name');
$table->string('email')->unique();
$table->string('azure_id')->nullable()->unique();
$table->string('photo')->nullable();
$table->string('job_title')->nullable();
$table->string('department')->nullable();
$table->string('phone')->nullable();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('password')->nullable();
$table->rememberToken();
$table->timestamps();
});

View File

@@ -21,7 +21,6 @@ public function up(): void
$table->string('status', 50)->default('in_progress');
$table->integer('score')->nullable();
$table->string('result', 50)->nullable();
$table->json('basic_info')->nullable();
$table->text('additional_comments')->nullable();
$table->timestamp('completed_at')->nullable();
$table->timestamps();