42
database/migrations/2013_12_07_105432_create_reviews.php
Executable file
42
database/migrations/2013_12_07_105432_create_reviews.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user