-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add foreign keys to organization_prefix_applications
- Loading branch information
1 parent
dad6daa
commit d2dde9c
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...base/migrations/2019_01_06_182945_create_organization_prefix_application_foreign_keys.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateOrganizationPrefixApplicationForeignKeys extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('organization_prefix_applications', function (Blueprint $table) { | ||
$table->foreign('organization_id')->references('id')->on('organizations'); | ||
$table->foreign('user_id')->references('id')->on('users'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('organization_prefix_applications', function (Blueprint $table) { | ||
$table->dropForeign(['organization_id']); | ||
$table->dropForeign(['user_id']); | ||
}); | ||
} | ||
} |