Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据库外键指定db_constraint=False 然后删除这个外键字段 迁移失败 #179

Open
jiyuzhi opened this issue Jul 21, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@jiyuzhi
Copy link

jiyuzhi commented Jul 21, 2021

生成了两条sql
ALTER TABLE product DROP FOREIGN KEY fk_product_user_37721d57;
ALTER TABLE product DROP COLUMN user_id;

执行 DROP FOREIGN KEY fk_product_user_37721d57; 会出错 因为指定了db_constraint=False 没有外键约束

@long2ice
Copy link
Member

嗯,这里应该是一个bug,db_constraint=False不应该drop外键

@long2ice long2ice added the bug Something isn't working label Jul 21, 2021
long2ice added a commit that referenced this issue Jul 22, 2021
@long2ice
Copy link
Member

试试最新dev分支

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants