This commit is contained in:
2022-11-01 11:07:41 +08:00
commit c23de98690
131 changed files with 14088 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCommentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('comments', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->index()->comment('评论用户');
$table->unsignedBigInteger('parent_id')->index()->comment('恢复XX');
$table->morphs('commentable');
$table->text('content')->comment('评论内容如果单条的就直接用其他的可以用json格式化存储');
$table->boolean('status')->default(0);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('comments');
}
}