Skip to content

Commit

Permalink
Update api resource and scope tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaminduR committed Oct 6, 2023
1 parent d59fcba commit d7a2734
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1262,27 +1262,27 @@ CREATE TABLE IF NOT EXISTS IDN_OAUTH_PAR (
);

CREATE TABLE IF NOT EXISTS API_RESOURCE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL,
IDENTIFIER VARCHAR(255) NOT NULL,
TENANT_ID INT NOT NULL,
DESCRIPTION VARCHAR(255),
TYPE VARCHAR(255) NOT NULL,
REQUIRES_AUTHORIZATION BOOLEAN NOT NULL,
CONSTRAINT IDENTIFIER_UNIQUE UNIQUE (TENANT_ID, IDENTIFIER)
CONSTRAINT IDENTIFIER_UNIQUE UNIQUE (IDENTIFIER, TENANT_ID)
);

CREATE TABLE IF NOT EXISTS SCOPE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL AUTO_INCREMENT,
API_ID VARCHAR(255) NOT NULL,
API_ID CHAR(36) NOT NULL,
NAME VARCHAR(255) NOT NULL,
DISPLAY_NAME VARCHAR(255) NOT NULL,
TENANT_ID INT NOT NULL,
DESCRIPTION VARCHAR(300),
FOREIGN KEY (API_ID) REFERENCES API_RESOURCE(ID) ON DELETE CASCADE,
CONSTRAINT SCOPE_UNIQUE UNIQUE (TENANT_ID, NAME)
CONSTRAINT SCOPE_UNIQUE UNIQUE (NAME, TENANT_ID)
);

-- --------------------------- INDEX CREATION -----------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1947,7 +1947,7 @@ CREATE TABLE IDN_ORG_USER_ASSOCIATION (
)
/
CREATE TABLE API_RESOURCE (
ID VARCHAR(255) PRIMARY KEY NOT NULL,
ID CHAR(36) PRIMARY KEY NOT NULL,
CURSOR_KEY INTEGER NOT NULL,
NAME VARCHAR(255) NOT NULL,
IDENTIFIER VARCHAR(255) NOT NULL,
Expand All @@ -1971,9 +1971,9 @@ CREATE TRIGGER API_RESOURCE_TRIG NO CASCADE
/

CREATE TABLE SCOPE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL,
API_ID VARCHAR(255) NOT NULL,
API_ID CHAR(36)) NOT NULL,
NAME VARCHAR(255) NOT NULL,
DISPLAY_NAME VARCHAR(255) NOT NULL,
TENANT_ID INT NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ CREATE TABLE IF NOT EXISTS IDN_ORG_USER_ASSOCIATION(
);

CREATE TABLE IF NOT EXISTS API_RESOURCE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL,
IDENTIFIER VARCHAR(255) NOT NULL,
Expand All @@ -1321,9 +1321,9 @@ CREATE TABLE IF NOT EXISTS API_RESOURCE (
);

CREATE TABLE IF NOT EXISTS SCOPE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL AUTO_INCREMENT,
API_ID VARCHAR(255) NOT NULL,
API_ID CHAR(36) NOT NULL,
NAME VARCHAR(255) NOT NULL,
DISPLAY_NAME VARCHAR(255) NOT NULL,
TENANT_ID INT NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ CREATE TABLE IDN_ORG_USER_ASSOCIATION (

IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[API_RESOURCE]') AND TYPE IN (N'U'))
CREATE TABLE API_RESOURCE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL IDENTITY,
NAME VARCHAR(255) NOT NULL,
IDENTIFIER VARCHAR(255) NOT NULL,
Expand All @@ -1465,9 +1465,9 @@ CREATE TABLE API_RESOURCE (

IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[SCOPE]') AND TYPE IN (N'U'))
CREATE TABLE SCOPE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL IDENTITY,
API_ID VARCHAR(255) NOT NULL,
API_ID CHAR(36) NOT NULL,
NAME VARCHAR(255) NOT NULL,
DISPLAY_NAME VARCHAR(255) NOT NULL,
TENANT_ID INT NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ CREATE TABLE IDN_ORG_USER_ASSOCIATION(
)ENGINE NDB;

CREATE TABLE IF NOT EXISTS API_RESOURCE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL,
IDENTIFIER VARCHAR(255) NOT NULL,
Expand All @@ -1492,9 +1492,9 @@ CREATE TABLE IF NOT EXISTS API_RESOURCE (
)ENGINE NDB;

CREATE TABLE IF NOT EXISTS SCOPE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL AUTO_INCREMENT,
API_ID VARCHAR(255) NOT NULL,
API_ID CHAR(36) NOT NULL,
NAME VARCHAR(255) NOT NULL,
DISPLAY_NAME VARCHAR(255) NOT NULL,
TENANT_ID INT NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ CREATE TABLE IDN_ORG_USER_ASSOCIATION(
)DEFAULT CHARACTER SET latin1 ENGINE INNODB;

CREATE TABLE IF NOT EXISTS API_RESOURCE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36), NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL AUTO_INCREMENT,
NAME VARCHAR(255) NOT NULL,
IDENTIFIER VARCHAR(255) NOT NULL,
Expand All @@ -1350,9 +1350,9 @@ CREATE TABLE IF NOT EXISTS API_RESOURCE (
)DEFAULT CHARACTER SET latin1 ENGINE INNODB;

CREATE TABLE IF NOT EXISTS SCOPE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY INTEGER NOT NULL AUTO_INCREMENT,
API_ID VARCHAR(255) NOT NULL,
API_ID CHAR(36) NOT NULL,
NAME VARCHAR(255) NOT NULL,
DISPLAY_NAME VARCHAR(255) NOT NULL,
TENANT_ID INT NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ DROP TABLE IF EXISTS API_RESOURCE;
DROP SEQUENCE IF EXISTS API_RESOURCE_SEQ;
CREATE SEQUENCE API_RESOURCE_SEQ;
CREATE TABLE API_RESOURCE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY SERIAL,
NAME VARCHAR(255) NOT NULL,
IDENTIFIER VARCHAR(255) NOT NULL,
Expand All @@ -1573,9 +1573,9 @@ DROP TABLE IF EXISTS SCOPE;
DROP SEQUENCE IF EXISTS SCOPE_SEQ;
CREATE SEQUENCE SCOPE_SEQ;
CREATE TABLE SCOPE (
ID VARCHAR(255) NOT NULL PRIMARY KEY,
ID CHAR(36) NOT NULL PRIMARY KEY,
CURSOR_KEY SERIAL,
API_ID VARCHAR(255) NOT NULL,
API_ID CHAR(36) NOT NULL,
NAME VARCHAR(255) NOT NULL,
DISPLAY_NAME VARCHAR(255) NOT NULL,
TENANT_ID INT NOT NULL,
Expand Down

0 comments on commit d7a2734

Please sign in to comment.