Skip to content

Commit

Permalink
Changed the order of the database migrations to prevent a conflict th…
Browse files Browse the repository at this point in the history
…at would happen due to a table not existing yet
  • Loading branch information
Andrew Reddin authored and Andrew Reddin committed May 11, 2016
1 parent 2f2c8d2 commit 55099b6
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/database/migrations.stub
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ class TeamworkSetupTables extends Migration
$table->integer( 'current_team_id' )->unsigned()->nullable();
} );

Schema::create( \Config::get( 'teamwork.team_invites_table' ), function(Blueprint $table)
{
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->integer('team_id')->unsigned();
$table->enum('type', ['invite', 'request']);
$table->string('email');
$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 All @@ -56,6 +41,22 @@ class TeamworkSetupTables extends Migration

$table->foreign( 'team_id' )->references( 'id' )->on( \Config::get( 'teamwork.teams_table' ) );
} );

Schema::create( \Config::get( 'teamwork.team_invites_table' ), function(Blueprint $table)
{
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->integer('team_id')->unsigned();
$table->enum('type', ['invite', 'request']);
$table->string('email');
$table->string('accept_token');
$table->string('deny_token');
$table->timestamps();
$table->foreign( 'team_id' )
->references( 'id' )
->on( \Config::get( 'teamwork.teams_table' ) )
->onDelete( 'cascade' );
});
}

/**
Expand Down

0 comments on commit 55099b6

Please sign in to comment.