提交代码
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateFollowablesTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('followables', function(Blueprint $table)
|
||||
{
|
||||
$table->bigInteger('user_id')->unsigned()->index('followables_user_id_foreign');
|
||||
$table->integer('followable_id')->unsigned();
|
||||
$table->string('followable_type')->index();
|
||||
$table->string('relation')->default('follow')->comment('follow/like/subscribe/favorite/upvote/downvote');
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('followables');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user