for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Eloquent\Model;
class CreateForeignKeys extends Migration {
public function up()
{
Schema::table('dashboard_apels', function(Blueprint $table) {
$table->foreign('province_id')->references('id')->on('provinces')
->onDelete('set null')
->onUpdate('restrict');
});
$table->foreign('regency_id')->references('id')->on('regencies')
Schema::table('regencies', function(Blueprint $table) {
}
public function down()
$table->dropForeign('dashboard_apels_province_id_foreign');
$table->dropForeign('dashboard_apels_regency_id_foreign');
$table->dropForeign('regencies_province_id_foreign');