Files
mtdb_movie/database/migrations/2013_12_07_105432_create_reviews.php
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

43 lines
936 B
PHP
Executable File

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateReviews extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('reviews', function(Blueprint $table)
{
$table->bigIncrements('id');
$table->text('body')->nullable();
$table->integer('score')->nullable()->index();
$table->integer('title_id')->unsigned()->index();
$table->integer('user_id')->unsigned()->index();
$table->timestamp('created_at')->nullable();
$table->timestamp('updated_at')->nullable();
$table->unique(['title_id', 'user_id']);
$table->collation = config('database.connections.mysql.collation');
$table->charset = config('database.connections.mysql.charset');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('reviews');
}
}