I have a Django-Postgres app deployed with Docker. I have two docker containers web
and db
and one docker volume for persistent storage.
My docker-compose.yml
file:
version: '2'
services:
db:
image: postgres
ports:
- '5432:5432'
volumes:
- 'postgres:/var/lib/postgresql/data'
env_file: .env
web:
build: .
command: ./start.sh
volumes:
- .:/app
ports:
- "8000:8000"
depends_on:
- db
env_file: .env
volumes:
postgres:
I made a change in my django model.py
:
class Meeting(models.Model):
[...]
participants = models.CharField(max_length=200)
to
class Meeting(models.Model):
[...]
user_participants = models.CharField(max_length=200)
However, this change is not reflected on my Django app and I get the following error:
column call_meeting.user_participants does not exist
I ran:
python manage.py makemigrations call
python manage.py migrate
Then I tried to delete Django migrations and re-run the above commands. I have tried to re-run docker-compose build
but none of them worked.
Why does this happen? Should I change the column names with raw SQL?