Skip to content

Commit

Permalink
Update Unique constraints in table definitions for SQL Server
Browse files Browse the repository at this point in the history
Replace unique constraint with unique unique filtered index to allow null values to be ignored.
  • Loading branch information
spvickers committed Mar 5, 2022
1 parent 65e4416 commit 5ecd7f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sql/lti4-platform-mssql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ CREATE TABLE lti2_tool (
created datetime2 NOT NULL,
updated datetime2 NOT NULL,
PRIMARY KEY (tool_pk),
CONSTRAINT UC_lti2_tool_initiate_login_url UNIQUE (initiate_login_url ASC)
INDEX UC_lti2_tool_initiate_login_url UNIQUE (initiate_login_url) WHERE (initiate_login_url IS NOT NULL)
);
4 changes: 2 additions & 2 deletions sql/lti4-tables-mssql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ CREATE TABLE lti2_consumer (
created datetime2 NOT NULL,
updated datetime2 NOT NULL,
PRIMARY KEY (consumer_pk),
CONSTRAINT UC_lti2_consumer_consumer_key UNIQUE (consumer_key),
CONSTRAINT UC_lti2_consumer_platform UNIQUE (platform_id, client_id, deployment_id)
INDEX UC_lti2_consumer_consumer_key UNIQUE (consumer_key) WHERE (consumer_key IS NOT NULL),
INDEX UC_lti2_consumer_platform UNIQUE (platform_id, client_id, deployment_id) WHERE (platform_id IS NOT NULL) AND (client_id IS NOT NULL) AND (deployment_id IS NOT NULL)
);

CREATE TABLE lti2_nonce (
Expand Down

0 comments on commit 5ecd7f5

Please sign in to comment.