Revision: 167
http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=167&view=rev
Author: crazedsanity
Date: 2010-06-15 02:13:49 +0000 (Tue, 15 Jun 2010)
Log Message:
-----------
Updated example upgrade.xml file.
Modified Paths:
--------------
trunk/0.3/upgrades/upgrade.xml
Modified: trunk/0.3/upgrades/upgrade.xml
===================================================================
--- trunk/0.3/upgrades/upgrade.xml 2010-06-15 02:12:26 UTC (rev 166)
+++ trunk/0.3/upgrades/upgrade.xml 2010-06-15 02:13:49 UTC (rev 167)
@@ -1,22 +1,37 @@
<upgrade>
- <system_note>To determine which section in matching to use, heed only the information
- beneath the tag that indicates the current database version (for 5.2.4,
- you would find information under matching for "v5.2.4"). This section
- indicates the version that it should upgrade the database to
- ("target_version"), the name of the script ("script_name"), the class name
- ("class_name"), and the name of the method within that class ("call_method")
- to call in order to perform the upgrade. The method should return TRUE on
- success: anything else would indicate failure. Upgrade failure may leave
- the system in an inconsistent state.
+ <system_note>To determine which section in matching to use, find the heading
+ that matches the version to upgrade FROM: i.e. if upgrading from v1.2.0-ALPHA3
+ to v1.2.0-ALPHA4, find the entry "v1.2.0-ALPHA3"; the "target_version" tag
+ beneath that entry indicates what the version will be afterward.
+ When building a script, the name of the file should be indicative of what it
+ will do, such as "upgradeTo1.2.0-ALPHA4.php". The class name should be
+ similar as well, but avoid dots and dashes; "upgrade_to_1_2_0_alpha4" would
+ be just fine. Generally I have the same method name ("call_method") for
+ performing the update, which may call other methods to get the job done.
+
IMPORTANT: in order to facilitate doing multiple version upgrades, the name
of the class must be UNIQUE to all the other classes. For this reason, the
- class name should be something like "v1_0_0_ALPHA1__to__v1_0_0_ALPHA2".
+ class name should be something like "upgrade_to_1_2_0_alpha4".
REMEMBER: the "target_version" should NEVER be higher than the next item
- beneath matching; this will cause horrible logic errors, causing an upgsrade
+ beneath matching; this will cause horrible logic errors, causing an upgrade
to get skipped, or an exception to be thrown, potentially leaving the system
in an unstable state. Unstable is bad, m'kay?</system_note>
- <matching />
+ <examples>
+ <v1.2.0-ALPHA3>
+ <target_version>1.2.0-ALPHA4</target_version>
+ <script_name>upgradeTo1.2.0-ALPHA4.php</script_name>
+ <class_name>upgrade_to_1_2_0_ALPHA4</class_name>
+ <call_method>run_upgrade</call_method>
+ </v1.2.0-ALPHA3>
+ <v1.2.0-ALPHA6>
+ <target_version>1.2.0-ALPHA7</target_version>
+ <script_name>upgradeTo1.2.0-ALPHA7.php</script_name>
+ <class_name>upgrade_to_1_2_0_ALPHA7</class_name>
+ <call_method>run_upgrade</call_method>
+ </v1.2.0-ALPHA6>
+ </examples>
+ <example_initialversion>0.1.0-BETA1</example_initialversion>
</upgrade>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|