Skip to content

Commit

Permalink
Merge branch '5.5' into 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 12, 2018
2 parents 468cb1b + e36c639 commit 33ea741
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Illuminate/Database/Migrations/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ abstract class Migration
*/
protected $connection;

/**
* Enables, if supported, wrapping the migration within a transaction.
*
* @var bool
*/
public $withinTransaction = true;

/**
* Get the migration connection name.
*
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Database/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ protected function runMigration($migration, $method)
};

$this->getSchemaGrammar($connection)->supportsSchemaTransactions()
&& $migration->withinTransaction
? $connection->transaction($callback)
: $callback();
}
Expand Down

0 comments on commit 33ea741

Please sign in to comment.