This commit is contained in:
Masroor Ehsan 2025-01-06 21:38:04 +06:00
parent d8b60a46b9
commit 110cd7626e
3 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ public function up(): void
{ {
Schema::create('institutes', function (Blueprint $table) { Schema::create('institutes', function (Blueprint $table) {
$table->id(); $table->id();
$table->uuid('guid')->unique()->index()->default(DB::raw('uuid_generate_v4()')); $table->uuid('guid')->unique()->index()->default(DB::raw("concat('INS-', gen_random_uuid())"));
$table->string('name')->unique(); $table->string('name')->unique();
$table->boolean('is_active')->default(false); $table->boolean('is_active')->default(false);
$table->string('address')->nullable(); $table->string('address')->nullable();

View File

@ -10,7 +10,7 @@ public function up(): void
{ {
Schema::create('facilities', function (Blueprint $table) { Schema::create('facilities', function (Blueprint $table) {
$table->id(); $table->id();
$table->uuid('guid')->unique()->index()->default(DB::raw('uuid_generate_v4()')); $table->uuid('guid')->unique()->index()->default(DB::raw("concat('FAC-', gen_random_uuid())"));
$table->boolean('is_active')->default(false); $table->boolean('is_active')->default(false);
$table->foreignId('institute_id')->constrained('institutes')->cascadeOnDelete(); $table->foreignId('institute_id')->constrained('institutes')->cascadeOnDelete();
$table->string('name'); $table->string('name');

View File

@ -12,7 +12,7 @@ public function up(): void
{ {
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {
$table->id(); $table->id();
$table->uuid('guid')->unique()->index()->default(DB::raw('uuid_generate_v4()')); $table->uuid('guid')->unique()->index()->default(DB::raw("concat('USR-', gen_random_uuid())"));
$table->boolean('is_active')->default(true); $table->boolean('is_active')->default(true);
$table->string('first_name'); $table->string('first_name');
$table->string('last_name')->nullable(); $table->string('last_name')->nullable();