You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE h (
id bigint
) ;
CREATE TABLE k (
id bigint,
id2 bigint
) ;
ALTER TABLE k ADD UNIQUE (id,id2);
ALTER TABLE h ADD CONSTRAINT fk_h FOREIGN KEY (id) REFERENCES k(id) MATCH SIMPLE ON DELETE NO ACTION ON UPDATE NO ACTION;
Error during import:
ERROR: there is no unique constraint matching given keys for referenced table "k"
Suggested Changes:
Add individual Unique / Primary keys to the referenced column.
The text was updated successfully, but these errors were encountered:
In MySQL, you can reference a column which is the part of a Unique Key or a Primary Key for a Foreign Key. This is not allowed in YB / PG.
Workaround: The referenced columns will need to have individual Unique / Primary keys.
Example:
Sample schema on the source (allowed in MySQL):
Exported Schema:
Error during import:
ERROR: there is no unique constraint matching given keys for referenced table "k"
Suggested Changes:
Add individual Unique / Primary keys to the referenced column.
The text was updated successfully, but these errors were encountered: