mirror of
https://github.com/DBDiff/DBDiff.git
synced 2026-04-25 05:15:49 +03:00
[GH-ISSUE #130] FOREIGN KEY #94
Labels
No labels
bug
enhancement
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/DBDiff#94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @flowerbling on GitHub (Jun 10, 2022).
Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/130
sql
...
PRIMARY KEY (
id),FOREIGN KEY (
logId) REFERENCEStable_a(id)...
...
PRIMARY KEY (
id),FOREIGN KEY (
orderId) REFERENCEStable_a(id)...
#---------- UP ----------
ALTER TABLE
xxxDROP CONSTRAINT; ALTER TABLE `xxx` ADD CONSTRAINT `xxx_ibfk_1` FOREIGN KEY (`logId`) REFERENCES `xxx1` (`id`); ALTER TABLE `yyy` DROP CONSTRAINT;ALTER TABLE
xxxADD CONSTRAINTyyy_ibfk_1FOREIGN KEY (orderId) REFERENCES yyy1(id`);#---------- DOWN ----------
ERROR 1064 (42000) at line 7: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONSTRAINT ``' at line 1