Skip to content
Commit 875c98f2 authored by François Martin's avatar François Martin
Browse files

refactor(backend): use custom user model for authentication

BREAKING CHANGE: If you are upgrading an existing `portal` installation, you MUST first deploy this version
and follow the migration steps BEFORE deploying any later version!

Django requires the first migration to be the one that initializes a custom user model
(see https://docs.djangoproject.com/en/3.1/topics/auth/customizing/#changing-to-a-custom-user-model-mid-project)
which is why all existing migrations had to be removed, which requires manual intervention during deployment.

Migration Steps:
- Stop the running docker containers, except for the database container
- Make a backup of the database
- Run the following query on the database: `TRUNCATE django_migrations`
- Deploy the image of EXACTLY this version (don't run the backend server yet)
- Run `./manage.py migrate --fake` on the backend container
- Run the backend server as usual
- From this point on, you can deploy any version later than this one,
using `./manage.py migrate` (without `--fake`) and running the server like usual
parent cef83225
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment