From 9185adb6111cd2074da5392fbe7a47a7451f8bb0 Mon Sep 17 00:00:00 2001 From: Sverre Nystad Date: Sat, 6 Jan 2024 15:01:15 +0100 Subject: [PATCH] Docs: Add instructions for fixing migration issues with docker --- backend/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/backend/README.md b/backend/README.md index c68bae9d..22109fbb 100644 --- a/backend/README.md +++ b/backend/README.md @@ -74,6 +74,23 @@ docker-compose run tutorai python manage.py makemigrations docker-compose run tutorai python manage.py migrate ``` +## If the migrations are not working + +One need to delete migrations files in migrations folders. Shut down the docker-compose and remove the database volume. Then run the following commands: + +```bash +docker-compose down +docker volume rm backend_postgres_data +``` +Then you can apply the migrations again. +```bash +docker-compose run tutorai python manage.py makemigrations +docker-compose run tutorai python manage.py migrate +``` +and then run the docker-compose again. +```bash +docker-compose up +``` ## How to create a new application in the backend