for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCollectionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create('collections', function (Blueprint $table) {
$table->increments('id');
$table->morphs('collectable');
$table->integer('user_id')->unsigned()->index();
$table->timestamps();
$table->softDeletes();
$table->unique([
'collectable_id',
'collectable_type',
'user_id',
], 'collect_user_unique');
});
}
* Reverse the migrations.
public function down()
Schema::dropIfExists('collections');