2014-12-20 16:56:46 +10:30
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class CreatePostsTable extends Migration {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('posts', function(Blueprint $table)
|
|
|
|
{
|
|
|
|
$table->increments('id');
|
|
|
|
$table->integer('discussion_id')->unsigned();
|
|
|
|
$table->integer('number')->unsigned()->nullable();
|
|
|
|
|
|
|
|
$table->dateTime('time');
|
|
|
|
$table->integer('user_id')->unsigned()->nullable();
|
|
|
|
$table->string('type')->nullable();
|
2015-01-21 12:02:25 +10:30
|
|
|
$table->text('content')->nullable();
|
|
|
|
$table->text('content_html')->nullable();
|
2014-12-20 16:56:46 +10:30
|
|
|
|
|
|
|
$table->dateTime('edit_time')->nullable();
|
|
|
|
$table->integer('edit_user_id')->unsigned()->nullable();
|
2015-02-12 14:35:24 +10:30
|
|
|
$table->dateTime('hide_time')->nullable();
|
|
|
|
$table->integer('hide_user_id')->unsigned()->nullable();
|
2014-12-20 16:56:46 +10:30
|
|
|
});
|
|
|
|
|
|
|
|
// add fulltext index to content (and title?)
|
|
|
|
// add unique index on [discussion_id, number] !!!
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::drop('posts');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|