Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A Dataset is a dump of the entire contents of the Mifos database, xml-formatted by DBUnit. It is used either to initialize the database state before running an acceptance test, or to validate its expected state after the test.

When the database undergoes an upgrade (either a schema change, a change in initial data, or some other transformation of existing data) the current DBUnit datasets may no longer be valid and may either cause tests to fail or abort in error or give erroneous results. The procedure outlined below updates the datasets to reflect current schema and default data. At the very least, one change will always occur – the contents of table DATABASE_VERSION is updated to a higher version number.

DataSetUpgradeUtil

DataSetUpgradeUtil is a utility that upgrades zipped DbUnit XML data set files from a previous data version to the current database version of Mifos. It can update an individual data set file or an entire directory of data set files at once.

...

Let's say we want to upgrade a single data set filed named "acceptance_small_008_dbunit.xml.zip" that is at database version 213 to the current database version, 215. The first thing to do (which would be nice to make more convenient somehow) is to get the latest-schema.sql file for database version 213. Rename the 213 version latest-schema.sql file to "latest-schema_last.sql" and put it in the application/src/main/sql directory where the current (215) latest-schema.sql file is.

By default the database "mifos_gazelle_acceptance" is used to load and upgrade the data. Its default user is root with password mysql. You can override this configuration in your local.properties file.

...