wiki:Upgrade_Database

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.
Last modified 7 years ago Last modified on 2010-07-16T00:00:19-07:00