From 565562ec561fddaaf4e4712cbab91eab29f1b5df Mon Sep 17 00:00:00 2001 From: Mark Jayson Fuentes Date: Sun, 3 May 2015 14:51:06 +0800 Subject: [PATCH] Patch to feature 2.2 NOTE: set api_key_id to nullable to fix issues regarding `SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails` errors --- database/migrations/2015_03_02_031822_create_api_keys_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2015_03_02_031822_create_api_keys_table.php b/database/migrations/2015_03_02_031822_create_api_keys_table.php index a691d4708..754bc27b2 100644 --- a/database/migrations/2015_03_02_031822_create_api_keys_table.php +++ b/database/migrations/2015_03_02_031822_create_api_keys_table.php @@ -31,7 +31,7 @@ public function up() Schema::create('api_logs', function (Blueprint $table) { $table->increments('id'); - $table->integer('api_key_id')->unsigned(); + $table->integer('api_key_id', false, true)->nullable(); $table->string('route', 150); $table->string('method', 6); $table->text('params');