Skip to content

Commit

Permalink
Add foreign keys to organization_prefix_applications
Browse files Browse the repository at this point in the history
  • Loading branch information
NFarrington committed Jan 6, 2019
1 parent dad6daa commit d2dde9c
Showing 1 changed file with 34 additions and 0 deletions.
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']);
});
}
}

0 comments on commit d2dde9c

Please sign in to comment.