diff --git a/application/config/version.php b/application/config/version.php index 0500d1f109f..b8b2d6dae92 100644 --- a/application/config/version.php +++ b/application/config/version.php @@ -14,7 +14,7 @@ $config['versionnumber'] = '3.0.0-beta.3'; //The current version of this branch $config['masterversion'] = '2.67.3'; //The current masters version merged into this branch -$config['dbversionnumber'] = 315; +$config['dbversionnumber'] = 316; $config['buildnumber'] = ''; $config['updatable'] = true; $config['assetsversionnumber'] = '2903'; diff --git a/application/helpers/update/updatedb_helper.php b/application/helpers/update/updatedb_helper.php index 969d3984f21..b8274b688e5 100644 --- a/application/helpers/update/updatedb_helper.php +++ b/application/helpers/update/updatedb_helper.php @@ -433,13 +433,22 @@ function db_upgrade_all($iOldDBVersion, $bSilent=false) { $oTransaction = $oDB->beginTransaction(); $oDB->createCommand()->update('{{template_configuration}}', - array('packages_to_load'=>'["pjax"]'), - 'id=1' - ); + array('packages_to_load'=>'["pjax"]'), + 'id=1' + ); + + $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>315),"stg_name='DBVersion'"); + $oTransaction->commit(); + } + if ($iOldDBVersion < 316) { + $oTransaction = $oDB->beginTransaction(); + + $oDB->createCommand()->renameColumn('{{template_configuration}}', 'templates_name', 'template_name'); - $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>315),"stg_name='DBVersion'"); - $oTransaction->commit(); - } + $oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>316),"stg_name='DBVersion'"); + $oTransaction->commit(); + } + } @@ -868,7 +877,7 @@ function upgradeTemplateTables304($oDB) // Add template configuration table $oDB->createCommand()->createTable('{{template_configuration}}', array( 'id' => 'pk', - 'templates_name' => 'string(150) NOT NULL', + 'template_name' => 'string(150) NOT NULL', 'sid' => 'integer DEFAULT NULL', 'gsid' => 'integer DEFAULT NULL', 'uid' => 'integer DEFAULT NULL', diff --git a/application/views/admin/templateoptions/_form.php b/application/views/admin/templateoptions/_form.php index 346fd3597f7..e31b6f77ebe 100644 --- a/application/views/admin/templateoptions/_form.php +++ b/application/views/admin/templateoptions/_form.php @@ -20,9 +20,9 @@ errorSummary($model); ?>
- labelEx($model,'templates_name'); ?> - textField($model,'templates_name',array('size'=>60,'maxlength'=>150)); ?> - error($model,'templates_name'); ?> + labelEx($model,'template_name'); ?> + textField($model,'template_name',array('size'=>60,'maxlength'=>150)); ?> + error($model,'template_name'); ?>
@@ -97,4 +97,4 @@ endWidget(); ?> -
\ No newline at end of file + diff --git a/application/views/admin/templateoptions/_search.php b/application/views/admin/templateoptions/_search.php index 5707ca26090..fabd15eeb95 100644 --- a/application/views/admin/templateoptions/_search.php +++ b/application/views/admin/templateoptions/_search.php @@ -17,8 +17,8 @@
- label($model,'templates_name'); ?> - textField($model,'templates_name',array('size'=>60,'maxlength'=>150)); ?> + label($model,'template_name'); ?> + textField($model,'template_name',array('size'=>60,'maxlength'=>150)); ?>
@@ -82,4 +82,4 @@ endWidget(); ?> -
\ No newline at end of file + diff --git a/application/views/admin/templateoptions/_view.php b/application/views/admin/templateoptions/_view.php index 55f35e70329..8b5b9d398a7 100644 --- a/application/views/admin/templateoptions/_view.php +++ b/application/views/admin/templateoptions/_view.php @@ -9,8 +9,8 @@ id), array('view', 'id'=>$data->id)); ?>
- getAttributeLabel('templates_name')); ?>: - templates_name); ?> + getAttributeLabel('template_name')); ?>: + template_name); ?>
getAttributeLabel('sid')); ?>: @@ -60,4 +60,4 @@ */ ?> - \ No newline at end of file + diff --git a/application/views/admin/templateoptions/admin.php b/application/views/admin/templateoptions/admin.php index 0041a28c03e..0408a15f2a2 100644 --- a/application/views/admin/templateoptions/admin.php +++ b/application/views/admin/templateoptions/admin.php @@ -46,7 +46,7 @@ 'filter'=>$model, 'columns'=>array( 'id', - 'templates_name', + 'template_name', 'sid', 'gsid', 'uid', diff --git a/application/views/admin/templateoptions/index.php b/application/views/admin/templateoptions/index.php index 6a151a9676c..549d569cc09 100644 --- a/application/views/admin/templateoptions/index.php +++ b/application/views/admin/templateoptions/index.php @@ -32,14 +32,14 @@ array( 'header' => gT('name'), - 'name' => 'templates_name', - 'value'=>'$data->templates_name', + 'name' => 'template_name', + 'value'=>'$data->template_name', 'htmlOptions' => array('class' => 'col-md-2'), ), array( 'header' => gT('Description'), - 'name' => 'templates_name', + 'name' => 'template_name', 'value'=>'$data->template->description', 'htmlOptions' => array('class' => 'col-md-3'), 'type'=>'raw', diff --git a/application/views/admin/templateoptions/update.php b/application/views/admin/templateoptions/update.php index ba8e04ac34f..1935467fa5b 100644 --- a/application/views/admin/templateoptions/update.php +++ b/application/views/admin/templateoptions/update.php @@ -9,7 +9,7 @@
id; ?>
-
' . $model->templates_name . ''; ?>
+
' . $model->template_name . ''; ?>
@@ -83,7 +83,7 @@ errorSummary($model); ?> - hiddenField($model,'templates_name'); ?> + hiddenField($model,'template_name'); ?> hiddenField($model,'sid'); ?> hiddenField($model,'gsid'); ?> hiddenField($model,'uid'); ?> diff --git a/application/views/admin/templateoptions/view.php b/application/views/admin/templateoptions/view.php index b5718155e22..b8e9a7b6f23 100644 --- a/application/views/admin/templateoptions/view.php +++ b/application/views/admin/templateoptions/view.php @@ -22,7 +22,7 @@ 'data'=>$model, 'attributes'=>array( 'id', - 'templates_name', + 'template_name', 'sid', 'gsid', 'uid', diff --git a/installer/php/create-database.php b/installer/php/create-database.php index 78b58fd5839..3d089fe2389 100644 --- a/installer/php/create-database.php +++ b/installer/php/create-database.php @@ -5,7 +5,7 @@ function createDatabase($oDB){ */ ////// Current database version: ////// - $databaseCurrentVersion = "315"; + $databaseCurrentVersion = "316"; /////////////////////////////////////// Yii::app()->loadHelper('database'); diff --git a/installer/sql/create-pgsql.sql b/installer/sql/create-pgsql.sql index 5e4c6e60f2e..ff306e0b20b 100644 --- a/installer/sql/create-pgsql.sql +++ b/installer/sql/create-pgsql.sql @@ -754,7 +754,7 @@ INSERT INTO prefix_templates VALUES -- ----------------------------------------------------- CREATE TABLE prefix_template_configuration ( "id" serial PRIMARY KEY NOT NULL, - templates_name character varying(150) NOT NULL, + template_name character varying(150) NOT NULL, sid integer DEFAULT NULL, gsid integer DEFAULT NULL, uid integer DEFAULT NULL, diff --git a/installer/sql/create-pgsql_compare.sql b/installer/sql/create-pgsql_compare.sql index 366cbc47fd3..bc016d78511 100644 --- a/installer/sql/create-pgsql_compare.sql +++ b/installer/sql/create-pgsql_compare.sql @@ -1216,7 +1216,7 @@ ALTER TABLE lime_surveys_languagesettings OWNER TO limesurvey; CREATE TABLE lime_template_configuration ( id integer NOT NULL, - templates_name character varying(150) NOT NULL, + template_name character varying(150) NOT NULL, sid integer, gsid integer, uid integer,