Skip to content

Automatic Database Migration #129

@lkiesow

Description

@lkiesow

With 2.2 we will change the database structure. That means that we need to re-create the database. That, in turn, means that we will lose data if we do no do anything about it.

This is definitely no problem for the status tables or the buffer, but it might be a problem for the finished recordings. Although we do not lose any real data since the recordings are still there and the metadata are in Opencast. Still, it would be convenient to keep that table.

Hence, the question what we want to do about it. Options are:

  1. No migration. Just delete the database.
  2. Manual migration (SQL upgrade file)
  3. Add DB versioning and add a complete automatic migration
  4. Add DB versioning, but only export relevant data, create new database and re-import the data

I would be ok with 1., I dislike 2., I think 3. is a lot of work and not worth the effort and finally, I like 4.

My idea about 4. would be to add a database version table, just containing a number. If the internal pyCA database version if different, we would export the recorded_event table as JSON, re-create the database and finally import the JSON again. This should be easier than a complete migration and we should be able to even import old data since we only need to interpret what information we have about a given event. If at some point one field becomes irrelevant, we can simply drop it. If there is a new one, we set it to null or generate a sensible default.

Packages could also make use of this method on upgrades by calling the migration script.

Any thoughts?

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions