Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Wrap migration in a transaction
The migration may or or may not error, as it has values like `$userTable` that are not guaranteed to be provided.
  • Loading branch information
dboskovic authored Oct 15, 2016
commit 911995e68c969a7e711533356bd5bf94e765f57c
5 changes: 5 additions & 0 deletions src/views/generators/migration.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class EntrustSetupTables extends Migration
*/
public function up()
{

DB::beginTransaction();

// Create table for storing roles
Schema::create('{{ $rolesTable }}', function (Blueprint $table) {
$table->increments('id');
Expand Down Expand Up @@ -55,6 +58,8 @@ public function up()

$table->primary(['permission_id', 'role_id']);
});

DB::commit();
}

/**
Expand Down