cineflex/database/migrations/2022_11_22_000001_create_cinemas_table.php

36 lines
897 B
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.
*
* @return void
*/
public function up()
{
Schema::create('cinemas', function (Blueprint $table) {
$table->id('cinema_id');
$table->timestamps();
$table->string('cinema_name');
$table->foreignId('address_id')->constrained('addresses', 'address_id');
$table->foreignId('user_id')->constrained('users', 'user_id'); // who created this cinema
$table->time('cinema_open');
$table->time('cinema_close');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cinemas');
}
};