mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-27 20:51:57 +00:00
39 lines
1023 B
PHP
39 lines
1023 B
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class CreateCommentsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('comments', function (Blueprint $table) {
|
|
$table->increments('id')->unsigned();
|
|
$table->integer('page_id')->unsigned();
|
|
$table->longText('text')->nullable();
|
|
$table->longText('html')->nullable();
|
|
$table->integer('parent_id')->unsigned()->nullable();
|
|
$table->integer('created_by')->unsigned();
|
|
$table->integer('updated_by')->unsigned()->nullable();
|
|
$table->index(['page_id', 'parent_id']);
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('comments');
|
|
}
|
|
}
|