Difference between revisions of "Improvements/Migrations"

From Archivematica
Jump to navigation Jump to search
(→‎Status: Update PRs)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 +
<div style="padding: 10px 10px; border: 1px solid black; background-color: #F79086;">This page is no longer being maintained and may contain inaccurate information. Please see the [https://www.archivematica.org/docs/latest/ Archivematica documentation] for up-to-date information. </div> <p>
  
 
== User Story ==
 
== User Story ==
Line 46: Line 47:
  
 
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]]

Latest revision as of 15:55, 11 February 2020

This page is no longer being maintained and may contain inaccurate information. Please see the Archivematica documentation for up-to-date information.

User Story[edit]

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[edit]

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[edit]

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

Analysis[edit]

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[edit]

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[edit]

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[edit]

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.