Skip to content

Commit

Permalink
Merge pull request #36 from andrewfreddin/master
Browse files Browse the repository at this point in the history
Changed the order of the database migrations
  • Loading branch information
mpociot committed May 11, 2016
2 parents 2f2c8d2 + 55099b6 commit 930edad
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 930edad

Please sign in to comment.