Skip to content

Commit

Permalink
Workaround for postgres (see cakephp/migrations#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchavik committed Aug 23, 2019
1 parent f7caaf7 commit 9ef4cbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/Seeds/RolesSeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ class RolesSeed extends AbstractSeed

public function run()
{
$this->getAdapter()->commitTransaction();
$Roles = TableRegistry::get('Croogo/Users.Roles');
$entities = $Roles->newEntities($this->records);
$result = $Roles->saveMany($entities);
$this->getAdapter()->beginTransaction();
}

}
2 changes: 2 additions & 0 deletions config/Seeds/UsersSeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ class UsersSeed extends AbstractSeed

public function run()
{
$this->getAdapter()->commitTransaction();
$Users = TableRegistry::get('Croogo/Users.Users');
$entity = $Users->newEntity($this->record);
$result = $Users->save($entity);
$this->getAdapter()->beginTransaction();
}

}

0 comments on commit 9ef4cbc

Please sign in to comment.