Skip to content

Upgrade Database

Alex Gondek edited this page Jul 16, 2026 · 1 revision

Warning

This content may be partially inaccurate, but has been kept for posterity. It was copied from iPeer's legacy Trac Wiki software (formerly hosted at https://ipeer.ctlt.ubc.ca/ which has since shut down).

Database Upgrades

This page describes the steps for developer to change the database structure and creating the upgrade files. If you are the end user, database upgrade will be done automatically for you when you run upgrade script after you login as admin.

When user installed a new version of iPeer, in which the database structures changed, user will be notified to run the upgrade script to upgrade database.

To do a database upgrade, please follow the steps below:

  • Make the database changes and do the development. Remember the changes.
  • Create a file under app/config/sql, name it as delta_#.sql, where # is the next database version. To find out the current version, check the line "define('DATABASE_VERSION', #);" in app/config/core.php. The next version will be current version +1.
  • Copy the SQL statements for changing the database into delta file.
  • Update the database version in app/config/core.php from:
define('DATABASE_VERSION', #);

To

define('DATABASE_VERSION', #+1);

Replace "#+1" with the real number.

  • That's it.

Clone this wiki locally