Skip to content

Instantly share code, notes, and snippets.

@brunojppb
Created December 5, 2018 09:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save brunojppb/138285919a03655843c3dd593f4a9b0a to your computer and use it in GitHub Desktop.
django migration commands using docker compose

Generate Migrations

# django = cocker compose service name
$ docker-compose exec -u $UID django ./manage.py makemigrations

Migrate DB

docker-compose exec -u $UID django ./manage.py migrate 

Migrate to specific migration

docker-compose exec -u $UID django ./manage.py migrate <APP_NAME> 000X_MIGRATION_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment