Difference between revisions of "Improvements/Migrations"

From Archivematica
Jump to navigation Jump to search
(→‎Status: Update PRs)
m (Add development documentation category)
Line 46: Line 46:
  
 
We will try adding Django migrations to 1.5.  If too many bugs (how many?) come up in the testing phase, we will revert to dpkg.
 
We will try adding Django migrations to 1.5.  If too many bugs (how many?) come up in the testing phase, we will revert to dpkg.
 +
 +
[[Category:Development documentation]]

Revision as of 14:59, 10 March 2017

User Story

As a developer, I want to automatically generated changes to the database. As a systems administrator, I want to reliably upgrade and downgrade Archivematica.

Status

Complete, included in Archivematica 1.5. The Archivematica Storage Service already has Django migrations (upgraded from the previous South migrations).

Pull requests: Archivematica 1.5 and Archivematica 1.6

Interest

Please feel free to add your organization's name to this list, if you have an interest in this improvement.

Analysis

Currently, Archivematica uses SQL files that are run by dpkg (for a package install) or a shell script (for an ansible or dev-helper install). These are complicated to write, have no error handling, and prone to failure.

We would like to move to Django migrations (new in Django 1.7) for the Archivematica 1.5 release.

dpkg

Pros:

  • existing process
  • faster in the short term to generate 1.5 packages
    • how much faster?

Cons:

  • harder to move to ansible from packages
    • If the package install already has Django migrations, then ansible doesn't have to worry about faking migrations
  • will report success even if only some of the upgrade SQL scripts were run

Django migrations

Code would be added to the debian postinst script to fake dpkg-run migrations. We would only back-create migrations for 1.4.1 to 1.5.0. Any older installs of Archivematica would have to upgrade to 1.4.1, then upgrade to 1.5.0.

Pros:

  • Easier to move to ansible from a package install
  • No hard-to-read mysql seed file that has to be re-generated for every release
  • Works better with tests, since testing and production code are the same (database not generated by dpkg SQL)

Cons:

  • Prone to bugs in the short term (relating to differences in how the mysql seed files created tables vs how Django models create tables)
  • All of these bugs have to be fixed before 1.5 release, which takes time away from other projects

Conclusion

We will try adding Django migrations to 1.5. If too many bugs (how many?) come up in the testing phase, we will revert to dpkg.