Welcome Guest, Not a member yet? Register   Sign In
Composite key as foreign key
#1

Hi!

There is not yet a method to assign compound foreign keys to reference with another table

Currently there is only one forge method to assign primary keys as compounds. addKey() 


I think there should be a method that works similarly but for foreign keys, to have a result like this:

Code:
create table Music (
    type char(1) not null check (type = 'M'),
    id integer not null,
    primary key (type, id),
    foreign key (type, id) references Product
);
Reply


Messages In This Thread
Composite key as foreign key - by luispastendev - 07-22-2020, 01:54 PM
RE: Composite key as foreign key - by kenjis - 03-05-2023, 05:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB