| @@ 7-35 (lines=29) @@ | ||
| 4 | use Illuminate\Database\Schema\Blueprint; |
|
| 5 | use Illuminate\Support\Facades\Schema; |
|
| 6 | ||
| 7 | class CreateRepliesTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create('replies', function (Blueprint $table) { |
|
| 17 | $table->bigIncrements('id'); |
|
| 18 | $table->integer('thread_id'); |
|
| 19 | $table->integer('user_id'); |
|
| 20 | $table->string('user_type'); |
|
| 21 | $table->text('body'); |
|
| 22 | $table->timestamps(); |
|
| 23 | }); |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * Reverse the migrations. |
|
| 28 | * |
|
| 29 | * @return void |
|
| 30 | */ |
|
| 31 | public function down() |
|
| 32 | { |
|
| 33 | Schema::dropIfExists('replies'); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| @@ 7-35 (lines=29) @@ | ||
| 4 | use Illuminate\Database\Schema\Blueprint; |
|
| 5 | use Illuminate\Support\Facades\Schema; |
|
| 6 | ||
| 7 | class CreateThreadSubscriptionTable extends Migration |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Run the migrations. |
|
| 11 | * |
|
| 12 | * @return void |
|
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create('discuss_subscription', function (Blueprint $table) { |
|
| 17 | $table->bigIncrements('id'); |
|
| 18 | $table->integer('subscribable_id'); |
|
| 19 | $table->string('subscribable_type'); |
|
| 20 | $table->integer('user_id'); |
|
| 21 | $table->string('user_type'); |
|
| 22 | $table->timestamps(); |
|
| 23 | }); |
|
| 24 | } |
|
| 25 | ||
| 26 | /** |
|
| 27 | * Reverse the migrations. |
|
| 28 | * |
|
| 29 | * @return void |
|
| 30 | */ |
|
| 31 | public function down() |
|
| 32 | { |
|
| 33 | Schema::dropIfExists('discuss_subscription'); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||