In my current setup, I have a django backend running in Elastic Beanstalk and a private RDS instance using mysql engine.
When I deploy, I want to migrate any migrations that haven’t been migrated yet.
This is the config file in my .ebextensions:
container_commands:
01_migrate:
command: "source /var/app/venv/*/bin/activate && python3 /var/app/current/python/manage.py migrate --noinput"
leader_only: true
This deploys successfully, but when I check the logs it gives me this output:
[INFO] Command 01_migrate
[INFO] -----------------------Command Output-----------------------
[INFO] Operations to perform:
[INFO] Apply all migrations: admin, app, auth, contenttypes, sessions
[INFO] Running migrations:
[INFO] No migrations to apply.
It says no migrations to apply when there are migrations that haven’t been applied yet.
I ran the same exact command after I ssh into the EC2 instance for my EB application and it applied the migrations successfully.
I can’t troubleshoot what the problem may be.