]> BookStack Code Mirror - bookstack/blob - database/migrations/2017_01_01_130541_create_comments_table.php
Added comments controller, model, repo, and the database schema. Modified existing...
[bookstack] / database / migrations / 2017_01_01_130541_create_comments_table.php
1 <?php
2
3 use Illuminate\Support\Facades\Schema;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Database\Migrations\Migration;
6
7 class CreateCommentsTable extends Migration
8 {
9     /**
10      * Run the migrations.
11      *
12      * @return void
13      */
14     public function up()
15     {
16         Schema::create('comments', function (Blueprint $table) {
17             $table->increments('id')->unsigned();                       
18             $table->integer('page_id')->unsigned();
19             $table->longText('text')->nullable();
20             $table->longText('html')->nullable();
21             $table->integer('parent_id')->unsigned()->nullable();
22             $table->integer('created_by')->unsigned();
23             $table->integer('updated_by')->unsigned()->nullable();
24             $table->index(['page_id', 'parent_id']);
25             $table->timestamps();
26         });
27     }
28
29     /**
30      * Reverse the migrations.
31      *
32      * @return void
33      */
34     public function down()
35     {
36         Schema::dropIfExists('comments');
37     }
38 }