for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class LanguageTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create('language', function (Blueprint $table) {
$table->increments('id');
$table->text('language')->nullable();
$table->integer('modified_by_user_id')->unsigned()->nullable();
$table->foreign('modified_by_user_id')->references('id')->on('user')->onDelete('set null');
$table->integer('shop_id')->unsigned();
$table->foreign('shop_id')->references('id')->on('shop')->onDelete('cascade');
$table->timestamps();
});
Schema::table('shop', function (Blueprint $table) {
$table->foreign('language_id')->references('id')->on('language')->onDelete('set null');
Schema::table('user', function (Blueprint $table) {
}
* Reverse the migrations.
public function down()
Schema::drop('language');