Actions

Database versioning: Difference between revisions

From LimeSurvey Manual

No edit summary
 
No edit summary
Line 2: Line 2:
=General=
=General=


These instructions apply to v 2.0 or later.
This page is a stump and tries to explain how to raise the DBVersion number and where to make changes in the source code. These instructions apply to v 2.0 or later.
 
You will typically need this if you are a LimeSurvey developer and want to introduce changes to the database


=Steps to add a new DB version\changes to the existing database=
=Steps to add a new DB version\changes to the existing database=
Line 8: Line 10:
*Open each file in \installer\sql and add the necessary changes. Make sure the changes are consistent across all three files. Pay attention to the database specific field types (check out other tables for comparison/examples). Important: If you need to use field type 'text' then make it 'varchar(max)' in MSSQL.
*Open each file in \installer\sql and add the necessary changes. Make sure the changes are consistent across all three files. Pay attention to the database specific field types (check out other tables for comparison/examples). Important: If you need to use field type 'text' then make it 'varchar(max)' in MSSQL.
*In each file in \installer\sql edit the last SQL statement in each to reflect the new dbversion number.
*In each file in \installer\sql edit the last SQL statement in each to reflect the new dbversion number.
*Open \application\helpers\update\updatedb_helper and in the end of the function db_upgrade_all() add a new condition block that does the necessary updates to the database scheme of the previous version. If you are using the proper functions the changes will be cross-DB compatible - check out how it is done in previous conditional blocks.
*Open \application\helpers\update\updatedb_helper and in the end of the function db_upgrade_all() add a new conditional code block that does the necessary updates to the database scheme of the previous version. If you are using the proper functions the changes will be cross-DB compatible - check out how it is done in previous conditional blocks.

Revision as of 13:37, 17 July 2012

General

This page is a stump and tries to explain how to raise the DBVersion number and where to make changes in the source code. These instructions apply to v 2.0 or later.

You will typically need this if you are a LimeSurvey developer and want to introduce changes to the database

Steps to add a new DB version\changes to the existing database

  • Open \application\config\version.php and raise the $dbversion variable by one. So if it 155 make it 156.
  • Open each file in \installer\sql and add the necessary changes. Make sure the changes are consistent across all three files. Pay attention to the database specific field types (check out other tables for comparison/examples). Important: If you need to use field type 'text' then make it 'varchar(max)' in MSSQL.
  • In each file in \installer\sql edit the last SQL statement in each to reflect the new dbversion number.
  • Open \application\helpers\update\updatedb_helper and in the end of the function db_upgrade_all() add a new conditional code block that does the necessary updates to the database scheme of the previous version. If you are using the proper functions the changes will be cross-DB compatible - check out how it is done in previous conditional blocks.