Mentions légales du service

Skip to content

Data migration process

BERJON Matthieu requested to merge data-migration-process into django

The current process to migrate the data suffers from side effects, especially when the database needs to drop, start from scratch and add some migrations through Django. Django handles really badly an existing database and it's impossible to reproduce a migration process from scratch when django migrations had been add up to the current database migration process.

This commit resolve this by reversing the process from migrating to old database to the new one and telling django to take this new database as it is to telling Django to create the database from his models and then inserting the data into the new database. By doing so, any migration applied through Django is taken into account at any stage during the process.

During the rewriting of the migration process I discovered several issues that needed to be addressed.

  • deletion of the token management library
  • add of a token field in the allgo user table
  • add of foreignkeys instead of onetoone fiels in the webapp to avoid a uniqueness issue on fields that were supposed to have several times the same ID.
  • Update of the default values of job's fields

Merge request reports