Commit 2eb91ace by Mark

CS fix

parent 3814c5c3
...@@ -141,13 +141,11 @@ class FixtureController extends Controller ...@@ -141,13 +141,11 @@ class FixtureController extends Controller
$transaction = Yii::$app->db->beginTransaction(); $transaction = Yii::$app->db->beginTransaction();
try try {
{
$this->loadFixtures($foundFixtures); $this->loadFixtures($foundFixtures);
$transaction->commit(); $transaction->commit();
} catch (\Exception $e) } catch (\Exception $e) {
{
$transaction->rollback(); $transaction->rollback();
$this->stdout("Exception occured, transaction rollback. Tables will be in same state.\n", Console::BG_RED); $this->stdout("Exception occured, transaction rollback. Tables will be in same state.\n", Console::BG_RED);
throw $e; throw $e;
...@@ -173,8 +171,7 @@ class FixtureController extends Controller ...@@ -173,8 +171,7 @@ class FixtureController extends Controller
$transaction = Yii::$app->db->beginTransaction(); $transaction = Yii::$app->db->beginTransaction();
try try {
{
$this->getDbConnection()->createCommand()->checkIntegrity(false)->execute(); $this->getDbConnection()->createCommand()->checkIntegrity(false)->execute();
foreach($tables as $table) { foreach($tables as $table) {
...@@ -186,8 +183,7 @@ class FixtureController extends Controller ...@@ -186,8 +183,7 @@ class FixtureController extends Controller
$this->getDbConnection()->createCommand()->checkIntegrity(true)->execute(); $this->getDbConnection()->createCommand()->checkIntegrity(true)->execute();
$transaction->commit(); $transaction->commit();
} catch (\Exception $e) } catch (\Exception $e) {
{
$transaction->rollback(); $transaction->rollback();
$this->stdout("Exception occured, transaction rollback. Tables will be in same state.\n", Console::BG_RED); $this->stdout("Exception occured, transaction rollback. Tables will be in same state.\n", Console::BG_RED);
throw $e; throw $e;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment