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

Change unique key of the UM_SHARED_ROLE table by adding UM_MAIN_ROLE_TENANT_ID #3693

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion distribution/kernel/carbon-home/dbscripts/db2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ CREATE TABLE UM_SHARED_ROLE(
UM_SHARED_ROLE_TENANT_ID INTEGER NOT NULL,
UM_MAIN_ROLE_TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (UM_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID, UM_SHARED_ROLE_TENANT_ID),
FOREIGN KEY (UM_SHARED_ROLE_ID, UM_SHARED_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
FOREIGN KEY (UM_MAIN_ROLE_ID, UM_MAIN_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE
)/
Expand Down
2 changes: 1 addition & 1 deletion distribution/kernel/carbon-home/dbscripts/h2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ CREATE TABLE IF NOT EXISTS UM_SHARED_ROLE(
UM_SHARED_ROLE_TENANT_ID INTEGER NOT NULL,
UM_MAIN_ROLE_TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (UM_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID, UM_SHARED_ROLE_TENANT_ID),
FOREIGN KEY (UM_SHARED_ROLE_ID, UM_SHARED_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
FOREIGN KEY (UM_MAIN_ROLE_ID, UM_MAIN_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE
);
Expand Down
2 changes: 1 addition & 1 deletion distribution/kernel/carbon-home/dbscripts/informix.sql
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ CREATE TABLE IF NOT EXISTS UM_SHARED_ROLE(
UM_SHARED_ROLE_TENANT_ID INTEGER NOT NULL,
UM_MAIN_ROLE_TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (UM_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID, UM_SHARED_ROLE_TENANT_ID),
FOREIGN KEY (UM_SHARED_ROLE_ID, UM_SHARED_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
FOREIGN KEY (UM_MAIN_ROLE_ID, UM_MAIN_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE
);
Expand Down
2 changes: 1 addition & 1 deletion distribution/kernel/carbon-home/dbscripts/mssql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ CREATE TABLE UM_SHARED_ROLE(
UM_SHARED_ROLE_TENANT_ID INTEGER NOT NULL,
UM_MAIN_ROLE_TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (UM_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID, UM_SHARED_ROLE_TENANT_ID),
FOREIGN KEY (UM_SHARED_ROLE_ID, UM_SHARED_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID),
FOREIGN KEY (UM_MAIN_ROLE_ID, UM_MAIN_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID)
);
Expand Down
2 changes: 1 addition & 1 deletion distribution/kernel/carbon-home/dbscripts/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ CREATE TABLE IF NOT EXISTS UM_SHARED_ROLE(
UM_SHARED_ROLE_TENANT_ID INTEGER NOT NULL,
UM_MAIN_ROLE_TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (UM_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID, UM_SHARED_ROLE_TENANT_ID),
FOREIGN KEY (UM_SHARED_ROLE_ID, UM_SHARED_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
FOREIGN KEY (UM_MAIN_ROLE_ID, UM_MAIN_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE
)ENGINE INNODB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ CREATE TABLE IF NOT EXISTS UM_SHARED_ROLE(
UM_SHARED_ROLE_TENANT_ID INTEGER NOT NULL,
UM_MAIN_ROLE_TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (UM_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID, UM_SHARED_ROLE_TENANT_ID),
FOREIGN KEY (UM_SHARED_ROLE_ID, UM_SHARED_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
FOREIGN KEY (UM_MAIN_ROLE_ID, UM_MAIN_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE
)ENGINE NDB;
Expand Down
2 changes: 1 addition & 1 deletion distribution/kernel/carbon-home/dbscripts/oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ CREATE TABLE UM_SHARED_ROLE(
UM_SHARED_ROLE_TENANT_ID INTEGER NOT NULL,
UM_MAIN_ROLE_TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (UM_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID, UM_SHARED_ROLE_TENANT_ID),
FOREIGN KEY (UM_SHARED_ROLE_ID, UM_SHARED_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
FOREIGN KEY (UM_MAIN_ROLE_ID, UM_MAIN_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE
)
Expand Down
2 changes: 1 addition & 1 deletion distribution/kernel/carbon-home/dbscripts/oracle_rac.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ CREATE TABLE UM_SHARED_ROLE(
UM_SHARED_ROLE_TENANT_ID INTEGER NOT NULL,
UM_MAIN_ROLE_TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (UM_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID, UM_SHARED_ROLE_TENANT_ID),
FOREIGN KEY (UM_SHARED_ROLE_ID, UM_SHARED_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
FOREIGN KEY (UM_MAIN_ROLE_ID, UM_MAIN_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE
)
Expand Down
2 changes: 1 addition & 1 deletion distribution/kernel/carbon-home/dbscripts/postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ CREATE TABLE UM_SHARED_ROLE(
UM_SHARED_ROLE_TENANT_ID INTEGER NOT NULL,
UM_MAIN_ROLE_TENANT_ID INTEGER NOT NULL,
PRIMARY KEY (UM_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID),
UNIQUE (UM_SHARED_ROLE_ID, UM_MAIN_ROLE_ID, UM_SHARED_ROLE_TENANT_ID),
FOREIGN KEY (UM_SHARED_ROLE_ID, UM_SHARED_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE,
FOREIGN KEY (UM_MAIN_ROLE_ID, UM_MAIN_ROLE_TENANT_ID) REFERENCES UM_HYBRID_ROLE(UM_ID, UM_TENANT_ID) ON DELETE CASCADE
);
Expand Down