migrations.py

Database migrations.

Each migration should be a function changing property names etc.

MIGRATIONS contain all migrations. To migrate the database from version X to version Y`, run all migrations in ``MIGRATIONS[current_version: software_version]. Version 1 to 2 should run MIGRATIONS[1:2], i.e. the function at MIGRATIONS[1] should be run.

migrations.migrate_v1_to_v2(db)[source]

Update the database fields to match the changes in the data structure.

  • Rename all ORDERS permissions to DATA_EDIT to match the updated permission names

  • Remove the cross_references field from collections and datasets

migrations.migrate_v2_to_v3(db)[source]

Update the database fields to match the changes in the data structure.

  • Remove the DATA_LIST and STATISTICS permissions from all users.