You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何从命令行列出已应用的数据库迁移?

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:23:34