laravel-learn-bbs/database/migrations/2018_01_03_010953_create_replies_table.php
2018-01-15 23:24:11 +08:00

24 lines
585 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateRepliesTable extends Migration
{
public function up()
{
Schema::create('replies', function (Blueprint $table) {
$table->increments('id');
$table->integer('topic_id')->unsigned()->default(0)->index();
$table->integer('user_id')->unsigned()->default(0)->index();
$table->text('content');
$table->timestamps();
});
}
public function down()
{
Schema::drop('replies');
}
}