Skip to content

Commit

Permalink
Created foreign key in team_invites
Browse files Browse the repository at this point in the history
Created foreign key in team_invites related to team. When I invite a user to team, after that I will delete this team and I'm trying to show name of team from invite, I get an error.
  • Loading branch information
michalkozikcombc committed Apr 20, 2016
1 parent a288854 commit 2c6d345
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/database/migrations.stub
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class TeamworkSetupTables extends Migration
$table->string('accept_token');
$table->string('deny_token');
$table->timestamps();
$table->foreign( 'team_id' )
->references( 'id' )
->on( \Config::get( 'teamwork.teams_table' ) )
->onDelete( 'cascade' );
});

Schema::create( \Config::get( 'teamwork.teams_table' ), function ( $table )
Expand Down

0 comments on commit 2c6d345

Please sign in to comment.