DjangoMigrations

Download Django for free

Parameters

django-admin commandDetails
makemigrations <my_app>Generate migrations for my_app
makemigrationsGenerate migrations for all apps
makemigrations --mergeResolve migration conflicts for all apps
makemigrations --merge <my_app>Resolve migration conflicts for my_app
makemigrations --name <migration_name> <my_app>Generate a migration for my_app with the name migration_name
migrate <my_app>Apply pending migrations of my_app to the database
migrateApply all pending migrations to the database
migrate <my_app> <migration_name>Apply or unapply up to migration_name
migrate <my_app> zeroUnapply all migrations in my_app
sqlmigrate <my_app> <migration_name>Prints the SQL for the named migration
showmigrationsShows all migrations for all apps
showmigrations <my_app>Shows all migrations in my_app

Related Examples

Change a CharField to a ForeignKey