megacommit
This commit is contained in:
parent
2451ab45cb
commit
34ed81516b
51 changed files with 1200 additions and 251 deletions
|
@ -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