Python中文
首页
教程
问答
标签
搜索
登录
注册
Django InconsistentMigrationHistory:迁移X在其对数据库“default”的依赖项Y之前应用
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>这个问题与<a href="https://stackoverflow.com/questions/38996599/django-manage-py-migration-applied-before-its-dependency">Django manage.py: Migration applied before its dependency</a>和{a2}相似,只是我没有压缩迁移;我还发现这些问题的答案不是很具体。在</p> <p>我有一个应用程序<code>lucy_web</code>,其中{<cd2>}会产生结果</p> <pre><code>lucy_web [X] 0001_initial [X] 0002_auto_20170614_2116 [X] 0003_auto_20170614_2139 [X] 0004_auto_20170614_2228 [X] 0005_auto_20170614_2329 [X] 0006_auto_20170615_2326 [X] 0007_auto_20170616_1827 [X] 0008_family_birth_parent [X] 0009_auto_20170621_2035 [X] 0010_family_account_holder [X] 0011_auto_20170621_2218 [X] 0012_auto_20170621_2219 [X] 0006_auto_20170616_0008 [X] 0007_auto_20170616_0016 [X] 0008_auto_20170616_0441 [X] 0009_merge_20170619_1835 [X] 0013_merge_20170621_2225 [X] 0010_auto_20170621_0101 [X] 0014_merge_20170626_1858 [X] 0010_family_user [X] 0014_merge_20170623_1748 [X] 0015_merge_20170627_0605 [X] 0016_auto_20170710_1447 [X] 0017_auto_20170710_1448 [X] 0018_session_expert_type [X] 0019_auto_20170726_1641 [X] 0020_auto_20170727_1457 [X] 0021_auto_20170727_1511 [X] 0022_auto_20170727_1518 [X] 0023_auto_20170728_1300 [X] 0024_auto_20170730_0939 [X] 0025_auto_20170730_1011 [X] 0026_auto_20170731_1433 [X] 0027_auto_20170731_2117 [X] 0026_category [X] 0028_merge_20170801_0732 [X] 0029_auto_20170801_0736 [X] 0030_family_lucy_guide [X] 0031_family_baby_name [X] 0032_auto_20170801_2215 [X] 0033_auto_20170801_2218 [X] 0034_auto_20170801_2230 [X] 0035_remove_expert_activation_date [X] 0035_category_inactive [X] 0036_merge_20170802_1543 [X] 0037_auto_20170802_1544 [X] 0038_auto_20170803_2127 [X] 0039_family_profile_link [X] 0040_family_account_holder_string [X] 0041_auto_20170808_0825 [X] 0024_expertsessiontype_packagesessiontype [X] 0042_merge_20170808_1302 [X] 0043_auto_20170808_1311 [X] 0044_auto_20170809_0750 [X] 0045_auto_20170809_1119 [X] 0046_auto_20170810_1159 [X] 0047_auto_20170811_0851 [X] 0048_auto_20170811_0851 [X] 0049_auto_20170811_0857 [X] 0050_auto_20170816_0821 [X] 0051_auto_20170817_1358 [X] 0052_auto_20170823_1317 [X] 0053_auto_20170831_1415 [X] 0054_session_requested_timeframe [X] 0055_userapn [X] 0055_auto_20170919_1103 [X] 0056_merge_20170920_1206 [X] 0057_auto_20171003_1506 [X] 0058_auto_20171016_2025 [X] 0059_auto_20171017_1233 [X] 0060_auto_20171017_1448 [X] 0061_notification [X] 0062_auto_20171019_1322 [X] 0063_family_tz_string [X] 0064_auto_20171019_1357 [X] 0065_auto_20171023_2251 [X] 0066_auto_20171027_1512 [X] 0067_auto_20171108_1719 [X] 0067_auto_20171108_1427 [X] 0068_merge_20171109_1418 [X] 0069_auto_20171202_1606 [X] 0070_auto_20171204_1217 [X] 0071_question_conditions [X] 0073_auto_20171205_1112 [X] 0067_auto_20171030_1700 [X] 0068_merge_20171113_2335 [X] 0069_auto_20171113_2344 [X] 0070_auto_20171114_0113 [X] 0071_merge_20171114_0125 [X] 0068_merge_20171113_1117 [X] 0069_merge_20171114_1530 [X] 0072_merge_20171114_1731 [X] 0074_merge_20171205_1443 [X] 0073_auto_20171122_0830 [X] 0075_merge_20171206_1111 [X] 0076_auto_20171219_1036 [X] 0077_session_proposed_time_4 [X] 0076_auto_20171211_1625 [X] 0078_merge_20171220_0841 [X] 0079_session_scheuling_notes [X] 0080_auto_20171227_0741 [X] 0081_auto_20171227_0754 [X] 0082_session_recommended [X] 0069_auto_20171212_0637 [X] 0078_merge_20180101_2244 [X] 0083_merge_20180102_1840 [X] 0084_sessiontype_session_cost [X] 0085_session_session_times_provided_at [X] 0086_auto_20180105_1501 [X] 0087_family_recommendations_run_at [X] 0084_package_demo [X] 0088_merge_20180112_1317 [X] 0089_session_session_times_reminded_at [X] 0089_family_next_outreach [X] 0090_merge_20180128_0227 [X] 0091_family_adopting_or_surrogate [X] 0092_auto_20180206_0906 [X] 0093_auto_20180206_1300 [X] 0094_auto_20180206_1430 [X] 0089_auto_20180122_1538 [X] 0091_merge_20180201_1308 [X] 0092_merge_20180205_1349 [X] 0095_merge_20180206_1651 [X] 0096_auto_20180208_1041 [X] 0095_preactivationfamily [X] 0097_merge_20180208_1042 [X] 0098_auto_20180208_1528 [X] 0098_auto_20180208_1327 [X] 0099_merge_20180208_1638 [X] 0098_auto_20180208_1119 [X] 0100_merge_20180208_1759 [X] 0099_preactivationfamily_alternate_email [X] 0101_merge_20180209_1128 [X] 0102_auto_20180213_1305 [X] 0103_auto_20180216_1040 [X] 0102_auto_20180215_1514 [X] 0104_merge_20180216_1427 [X] 0103_question_index [X] 0105_merge_20180216_1708 [X] 0106_package_gift_boxes [X] 0107_auto_20180220_0534 [X] 0108_remove_package_includes_boxes [X] 0109_family_gift_box_notification_sent_at [X] 0110_auto_20180221_0907 [X] 0111_auto_20180221_0908 [X] 0112_auto_20180221_0909 [X] 0102_checkintype [X] 0103_auto_20180212_1444 [X] 0104_checkin [X] 0105_auto_20180213_1433 [X] 0106_auto_20180214_1143 [X] 0107_auto_20180214_1601 [X] 0108_auto_20180215_1141 [X] 0109_merge_20180220_1039 [X] 0110_auto_20180220_1039 [X] 0111_merge_20180228_0759 [X] 0113_merge_20180302_1226 [X] 0114_family_country [X] 0115_auto_20180308_0737 [X] 0116_auto_20180309_0642 [X] 0117_auto_20180313_1110 [X] 0118_auto_20180314_1205 [X] 0119_auto_20180314_1206 [X] 0120_auto_20180314_1207 [X] 0092_auto_20180207_1125 [X] 0110_merge_20180221_1249 [X] 0113_merge_20180302_0919 [X] 0114_merge_20180308_0008 [X] 0121_merge_20180316_1850 [X] 0122_auto_20180320_0340 [X] 0123_auto_20180320_0341 [X] 0124_auto_20180320_0342 [X] 0118_company_default_package [X] 0122_merge_20180319_1109 [X] 0122_auto_20180319_1739 [X] 0123_merge_20180320_1448 [X] 0125_merge_20180322_1639 [X] 0126_auto_20180327_1639 [X] 0127_auto_20180328_1621 [X] 0125_auto_20180322_1605 [X] 0126_merge_20180323_1632 [X] 0128_merge_20180328_1723 [X] 0129_auto_20180328_1731 [X] 0126_auto_20180327_0734 [X] 0127_merge_20180328_0155 [X] 0130_merge_20180328_2230 [X] 0127_auto_20180327_1638 [X] 0128_merge_20180328_1728 [X] 0130_merge_20180328_1845 [X] 0131_merge_20180329_0038 [X] 0132_auto_20180329_1045 [X] 0129_merge_20180328_1746 [X] 0131_merge_20180329_0938 [X] 0133_merge_20180329_1632 [X] 0134_auto_20180402_1026 [X] 0135_auto_20180402_1137 [X] 0136_sessiontype_first_trimester [X] 0136_auto_20180403_1321 [X] 0137_merge_20180403_1550 [X] 0138_auto_20180404_1316 [X] 0136_lucyguide_guide_email [ ] 0137_auto_20180405_1540 [X] 0139_merge_20180405_1700 [X] 0140_auto_20180406_1412 [X] 0141_auto_20180411_1757 [X] 0142_remove_question_update_related [X] 0143_auto_20180411_1812 [X] 0141_expert_phone_country [X] 0142_preactivationfamily_phone_country [X] 0144_merge_20180418_0800 [X] 0145_sessiontype_short_description [X] 0146_auto_20180425_1133 [X] 0146_auto_20180424_1119 [X] 0147_merge_20180426_0939 [X] 0141_auto_20180419_1028 [X] 0146_merge_20180425_1008 [X] 0147_merge_20180425_1522 [X] 0148_merge_20180504_1138 [X] 0149_auto_20180509_1345 [X] 0150_family_adoption_date [X] 0151_auto_20180511_1357 [X] 0152_auto_20180511_1403 [X] 0153_auto_20180515_1246 [X] 0150_auto_20180514_1410 [X] 0151_merge_20180517_1043 [X] 0154_merge_20180517_1753 [X] 0155_auto_20180518_1334 [X] 0152_package_preconception [X] 0156_merge_20180522_1139 [X] 0157_auto_20180523_0610 [X] 0150_auto_20180516_1452 [X] 0151_merge_20180522_1134 [X] 0158_merge_20180523_1127 [X] 0156_lucyguide_intro [X] 0159_merge_20180524_1358 [X] 0151_auto_20180518_1415 [X] 0157_merge_20180522_1342 [X] 0158_merge_20180522_1439 [X] 0152_auto_20180523_1052 [X] 0153_merge_20180523_1213 [X] 0159_merge_20180523_1503 [X] 0160_merge_20180524_1507 [X] 0161_auto_20180530_2140 [X] 0161_auto_20180529_1127 [X] 0162_merge_20180531_0009 [X] 0163_auto_20180627_1309 [X] 0164_sessioncategory_name_slug [X] 0165_auto_20180627_populate_name_slugs </code></pre> <p>我创建了最后两个迁移(涉及<code>name_slugs</code>),但数据迁移{<cd4>}在我编辑之后似乎没有运行,所以我从<code>django_migrations</code>表中删除了相应的行。在</p> <p>然而,现在,即使我尝试<code>python manage.py makemigrations</code>,也会出现以下错误:</p> ^{pr2}$ <p>我怎么解决这个问题?我能简单地把父母标记为申请吗?在</p> <p><strong>更新</strong></p> <p>似乎依赖项迁移甚至不在<code>django_migrations</code>表中:</p> <p><a href="https://i.stack.imgur.com/U7HoE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U7HoE.png" alt="enter image description here"/></a></p> <p>我想把它放在这张桌子上可以解决这个问题。我怎么能做到呢?在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>一般来说,人们可以:</p> <ul> <li>注释掉<code>INSTALLED_APPS</code>中的应用程序,该应用程序的迁移被过早应用</li> <li>运行迁移,允许先迁移依赖项</li> <li>删除评论</li> <li>再次运行迁移</li> </ul>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何添加虚拟方法
2 回答
如何添加表示整数的擦边字符串?
1 回答
如何添加要在Bokeh中使用的新font.ttf文件?
1 回答
如何添加要显示的矩阵XY轴编号和XY轴
6 回答
如何添加计数?
8 回答
如何添加计数器函数?
7 回答
如何添加计数器列来计算数据帧中另一列中的特定值?
7 回答
如何添加计数器来跟踪while循环中的月份和年份?
4 回答
如何添加计数并删除countplot的顶部和右侧脊椎?
4 回答
如何添加计时器wx.应用程序更新窗口对象的主循环?
2 回答
如何添加评论到帖子?PostDetailVew,Django 2.1.5
3 回答
如何添加评论拉梅尔亚姆
2 回答
如何添加诸如矩阵Python/Pandas之类的数据帧?
7 回答
如何添加谷歌地点自动完成到Flask?
2 回答
如何添加超时、python discord bot
6 回答
如何添加超过1dp的检查
10 回答
如何添加距离方法
7 回答
如何添加跟随游戏的敌人精灵
6 回答
如何添加路径以便python可以找到程序?
10 回答
如何添加身份验证/安全性以使用happybase访问HBase?
4 回答