for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of questocat/laravel-referral package.
*
* (c) questocat <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateReferralsTable extends Migration
{
/**
* Run the migrations.
public function up()
Schema::create('referrals', function (Blueprint $table) {
$table->increments('id');
$table->integer('referrer_id')->unsigned();
$table->integer('referral_id')->unsigned();
$table->foreign('referrer_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('referral_id')->references('id')->on('users')->onDelete('cascade');
$table->timestamps();
});
}
* Reverse the migrations.
public function down()
Schema::dropIfExists('referrals');