39 lines
1.1 KiB
PHP
39 lines
1.1 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('showings', function (Blueprint $table) {
|
||
|
|
$table->id();
|
||
|
|
$table->foreignId('movie')
|
||
|
|
->constrained(table: 'movies', indexName: 'showings_movie')
|
||
|
|
->cascadeOnDelete();
|
||
|
|
$table->foreignId('schedule')
|
||
|
|
->constrained(table: 'schedules', indexName: 'showings_schedule')
|
||
|
|
->cascadeOnDelete();
|
||
|
|
$table->foreignId('owner')
|
||
|
|
->constrained(table: 'users', indexName: 'showings_owner')
|
||
|
|
->cascadeOnDelete();
|
||
|
|
$table->boolean('is_public')->default(false);
|
||
|
|
$table->dateTime('showtime');
|
||
|
|
$table->timestamps();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Reverse the migrations.
|
||
|
|
*/
|
||
|
|
public function down(): void
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('showings');
|
||
|
|
}
|
||
|
|
};
|