cineflex/database/migrations/2022_11_22_000002_create_genre_table.php

33 lines
699 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('genres', function (Blueprint $table) {
$table->id('genre_id');
$table->timestamps();
$table->addColumn('string', 'genre_name', ['length' => 255]);
$table->unique(['genre_name']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('genres');
}
};