Files
zh-chat-server/database/migrations/2022_10_27_103121_create_likes_table.php
2022-11-01 11:07:41 +08:00

34 lines
699 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLikesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('likes', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->index()->comment('点赞用户');
$table->morphs('likeable');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('likes');
}
}