Hi I want to achieve one ot one relation ship between three tables such that rtTicketId (1) can only be used vmID(1) and cannot be used by dbId(1).
create table IF NOT EXISTS RequestTable (
rtTicketId bigserial unique not null AUTO_INCREMENT,
primary key (rtTicketId));
create table IF NOT EXISTS Vm (
vmId bigserial unique not null AUTO_INCREMENT,
primary key (vmId),
foreign key (rtTicketId) references RequestTable(rtTicketId));
create table IF NOT EXISTS Db (
dbId bigserial unique not null AUTO_INCREMENT,
rtTicketId bigserial unique not null,
primary key (dbId),
foreign key (rtTicketId) references RequestTable(rtTicketId));
I have Done this but this create one to one relation between only two separately. I want rt id to be unique . right now both vm and db table are able to use same rtTicketId to connect to request table. I dont want that