megacommit
This commit is contained in:
parent
2451ab45cb
commit
34ed81516b
51 changed files with 1200 additions and 251 deletions
|
@ -19,7 +19,7 @@ return new class extends Migration
|
|||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->enum('role', ['default', 'employee', 'manage'])->default('default');
|
||||
$table->enum('role', ['default', 'employee', 'manage', 'admin'])->default('default');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
|
|
@ -19,8 +19,8 @@ return new class extends Migration
|
|||
$table->foreignId('permission_id')->constrained('permissions', 'permission_id');
|
||||
$table->foreignId('user_id')->constrained('users', 'user_id');
|
||||
// end can be null to mark indefinitely
|
||||
$table->date('user_permission_start')->useCurrent();
|
||||
$table->date('user_permission_end')->nullable();
|
||||
// $table->date('user_permission_start')->useCurrent();
|
||||
// $table->date('user_permission_end')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('user_assignments', function (Blueprint $table) {
|
||||
$table->id('user_assignment_id');
|
||||
$table->timestamps();
|
||||
$table->foreignId('cinema_id')->constrained('cinemas', 'cinema_id');
|
||||
$table->foreignId('user_id')->constrained('users', 'user_id');
|
||||
$table->unique(['cinema_id', 'user_id']); // only one user per cinema
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('user_assignments');
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue