Database Data Management

From Archivematica
Jump to navigation Jump to search

Main Page > Development > Development documentation > Database Data Management

For the 1.0 Release

The data for the transcoder will need to be maintained by the FPR. The table structure will be maintained by the package.

All pk INT's will be replaced will UUIDs. This will allow for local customizations to be distinguished from the original data provided in archivematica.

All tables will have a replaces UUID column added. This column will be populated when a provided rule is replaced with an updated/custom one. As part of the update, the system will need to identify items that have been replaced, and update the foreign keys pointing at it to the updated rule. Warning: not all foreign keys are explicit in the database. Some are a "combined foriegn key", like Tasks Configs: Task type will inform the code what table to look at, and taskTypePKReference will specify the fk.


To separate data for the transcoder, we'll be using a series of mysql dumps. Once the FPR data is seperate, the developer can work on a means of populating that into their database, with the columns they require, and getting them into the database through an API.

Deployed Data management

Every change to the DB for workflow/FPR should be assigned a new UUID, so that it is not confused or overwritten on update. For tracking purposes the replaces column should be populated accordingly.


A custom script for updating from the 0.9 to 1.0 will be developed to track existing SIPs/Tranfers/Files in the system, and not lose any data associated with them. This should be a msyql script to be run by the tool Austin has found for managing DB's across releases.

For the 1.1 Release

Development changes for the db will occur through a sql script, applied against the previous release.


The 1.0 schema will remain in the code. Rebuilding the database will consist of the following steps:

  1. Build the database from the 1.0 schema
  2. Apply update patch sql script file
  3. Run update script, that will replace the updated rows where specified.

The 1.0 schema will remain untouched from the 1.0 release.
The apply patch will be edited to make changes for the 1.1 release.
The update script will be developed for this release.

All dev changes to the db will occur in the patch or from the FPR.


Updating from 1.0 to 1.1 can run the patch.

New installs will run a script generated as part of the release process. It will be a dump of the 0.9 with the patch applied. Future releases will use this as the base for development in the next release.

Deployed Data management

Same as 1.0

How this works with local customizations

The local customization made in 1.0 will not be overwritten by the ones made in the update, because all the fk's will already have been updated, so there would be nothing to replace, and point at the new rule.

For the future Releases

Each release keeps the base sql dump from the previous release. A patch file is generated against this dump for the release.