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

dms移除表的外键 #141

Closed
rocky114 opened this issue Jan 15, 2024 · 1 comment
Closed

dms移除表的外键 #141

rocky114 opened this issue Jan 15, 2024 · 1 comment
Assignees
Labels
not_compatible publish-pre3 verified 已经由测试验证过的issue
Milestone

Comments

@rocky114
Copy link
Contributor

rocky114 commented Jan 15, 2024

目前gorm生成的关联表会自动生成外键约束,如:CONSTRAINT fk_members_role_with_op_ranges FOREIGN KEY (member_uid) REFERENCES members (uid)

增加配置选项 DisableForeignKeyConstraintWhenMigrating 关闭关联表的外键约束生成,提供脚本删除已存在的外键约束

删除已存在的外键约束

alter table member_group_role_op_ranges drop foreign key fk_member_groups_role_with_op_ranges;

alter table member_group_users drop foreign key fk_member_group_users_member_group;
alter table member_group_users drop foreign key fk_member_group_users_user;

alter table member_role_op_ranges drop foreign key fk_members_role_with_op_ranges;

alter table role_op_permissions drop foreign key fk_role_op_permissions_op_permission;
alter table role_op_permissions drop foreign key fk_role_op_permissions_role;

alter table user_group_users drop foreign key fk_user_group_users_user;
alter table user_group_users drop foreign key fk_user_group_users_user_group;

alter table user_op_permissions drop foreign key fk_user_op_permissions_op_permission;
alter table user_op_permissions drop foreign key fk_user_op_permissions_user;
@taolx0
Copy link
Collaborator

taolx0 commented Jan 31, 2024

UI: main 743412d8
DMS: main-ee 46df963
SQLE: main-ee 342c635080
image
image

@taolx0 taolx0 added the verified 已经由测试验证过的issue label Jan 31, 2024
LordofAvernus pushed a commit that referenced this issue Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not_compatible publish-pre3 verified 已经由测试验证过的issue
Projects
None yet
Development

No branches or pull requests

3 participants