Skip to content

Commit

Permalink
Dev: Add transaction object; only drop table if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt authored and TonisOrmisson committed Jul 14, 2017
1 parent 057674a commit c6f560b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -361,10 +361,18 @@ function createSurveyMenuTable293($oDB) {
}
}

function upgradeTemplateTables295($oDB){
/**
* @param $oDB
* @return void
*/
function upgradeTemplateTables295($oDB)
{
$oTransaction = $oDB->beginTransaction();

// drop the old survey rights table
$oDB->createCommand()->dropTable('{{templates}}');
// Drop the old survey rights table.
if (tableExists('{templates}')) {
$oDB->createCommand()->dropTable('{{templates}}');
}

// Create templates table
$oDB->createCommand()->createTable('{{templates}}', array(
Expand Down

0 comments on commit c6f560b

Please sign in to comment.