Author: jcouteau Date: 2010-04-23 16:05:56 +0200 (Fri, 23 Apr 2010) New Revision: 24 Log: Improve migration doc Modified: trunk/src/site/rst/migration.rst Modified: trunk/src/site/rst/migration.rst =================================================================== --- trunk/src/site/rst/migration.rst 2010-04-23 14:02:54 UTC (rev 23) +++ trunk/src/site/rst/migration.rst 2010-04-23 14:05:56 UTC (rev 24) @@ -18,9 +18,15 @@ ==================================== After your application launch and before any request, you should store all the -extensions needed by your application, in their last version. -Then you need to add to the registry all the specific migrations for extensions. +extensions needed by your application, in their last version :: + store(myExtension); + +Then you need to add to the registry all the specific migrations for +extensions:: + + WikittyExtensionMigration.migrationRegistry.put("myExtension", myMigrationClass); + You can now use your data properly, they will be migrated at loading time. If you want to migrate objects before using them (for requests purpose for @@ -32,3 +38,16 @@ store(Client) Take care to the cost of the indexation compared to the data volume. + +Specific migrations +=================== + +Wikitty makes an automatic migration in cas of deleted fields, added fields or +renamed fields (need to add a renameFrom tag on the field). + +For other kind of migration, you might want to create your own migration class +that implements WikittyExtensionMigration. This class only needs to make the +migration from a version to the next version, for example version 1 to version 2. +In cas of a migration needed from version 1 to version 4, Wikitty will +automatically call the classes to migrate form version 1 to 2, then from version +2 to 3 and so on.
participants (1)
-
jcouteau@users.nuiton.org