删除表后迁移数据库架构时出现问题
我必须将模型中的字段从日期更改为整数。 Schemamigration 无法做到这一点,所以我不得不删除该表(没有数据,所以没关系)。进行更改后,我尝试创建一个新的架构迁移以使用更新的字段创建新表。由于某种原因,模式迁移找不到任何更改。无论如何,我尝试运行迁移,它说关系“表名”不存在。我尝试了 dbsync 但它跳过了我的项目。它说我必须使用迁移。
关于做什么/可能导致此问题的任何想法?
-谢谢
I had to change a field in my model from date to integer. Schemamigration could not do this so i had to delete the table (there was no data so it didn't matter). After i made the change I tried to create a new schemamigration to create the new table with the updated field. For some reason schemamigration could not find any changes. I tried to run migrate anyway and it said relation "tablename" does not exist. I tried dbsync but it skips my project. It says i have to use migration.
Any ideas of what to do / what could be causing this issue?
-Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能仍然在
south/
文件夹中保留旧的迁移。如果您无论如何都从新数据库开始,您也可以删除旧的迁移。You probably still have the old migrations in the
south/
folder. If you anyway start with a new database, you can as well delete the old migrations.