Skip to content

Commit

Permalink
Remove down method in the upgrade migration
Browse files Browse the repository at this point in the history
  • Loading branch information
santigarcor committed Jun 1, 2017
1 parent 96ada16 commit d4836f9
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/views/generators/upgrade-migration.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,5 @@ public function up()
*/
public function down()
{
Schema::table('{{ $laratrust['role_user_table'] }}', function (Blueprint $table) {
$table->dropForeign(['{{ $laratrust['role_foreign_key'] }}']);
$table->dropPrimary(['{{ $laratrust['user_foreign_key'] }}', '{{ $laratrust['role_foreign_key'] }}', 'user_type']);
$table->dropColumn('user_type');

$table->foreign('{{ $laratrust['user_foreign_key'] }}')->references('{{ $user->getKeyName() }}')->on('{{ $user->getTable() }}')
->onUpdate('cascade')->onDelete('cascade');
$table->foreign('{{ $laratrust['role_foreign_key'] }}')->references('id')->on('{{ $laratrust['roles_table'] }}')
->onUpdate('cascade')->onDelete('cascade');
$table->primary(['{{ $laratrust['user_foreign_key'] }}', '{{ $laratrust['role_foreign_key'] }}']);
});

Schema::table('{{ $laratrust['permission_user_table'] }}', function (Blueprint $table) {
$table->dropForeign(['{{ $laratrust['permission_foreign_key'] }}']);
$table->dropPrimary(['{{ $laratrust['permission_foreign_key'] }}', '{{ $laratrust['user_foreign_key'] }}', 'user_type']);
$table->dropColumn('user_type');

$table->foreign('{{ $laratrust['user_foreign_key'] }}')->references('{{ $user->getKeyName() }}')->on('{{ $user->getTable() }}')
->onUpdate('cascade')->onDelete('cascade');
$table->foreign('{{ $laratrust['permission_foreign_key'] }}')->references('id')->on('{{ $laratrust['permissions_table'] }}')
->onUpdate('cascade')->onDelete('cascade');
$table->primary(['{{ $laratrust['permission_foreign_key'] }}', '{{ $laratrust['user_foreign_key'] }}']);
});
}
}

0 comments on commit d4836f9

Please sign in to comment.