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');
|
||
|
}
|
||
|
}
|