如何从命令行列出已应用的数据库迁移?
Django Migration Status Update
Just finished working through migrations in my Django project, here's what I did and the status I see:
First, I generated the necessary migration files with:
python manage.py makemigrations
Next, I applied all those migrations to the database using:
python manage.py migrate
To double-check everything was applied correctly, I ran the showmigrations command, and here's the output:
admin [X] 0001_initial [X] 0002_logentry_remove_auto_add auth [X] 0001_initial [X] 0002_alter_permission_name_max_length [X] 0003_alter_user_email_max_length [X] 0004_alter_user_username_opts [X] 0005_alter_user_last_login_null [X] 0006_require_contenttypes_0002 [X] 0007_alter_validators_add_error_messages [X] 0008_alter_user_username_max_length [X] 0009_alter_user_last_name_max_length boards [...]
The [X] next to each migration indicates that it has been successfully applied to the database. The boards app's migration list is truncated in the output, but running the command again will display the full set of migrations for that app if needed.
内容的提问来源于stack exchange,提问作者Richard Rublev
相关产品推荐
相关产品推荐

