-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
237 additions
and
23 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
...rator/accelerators/ob-is/carbon-home/dbscripts/open-banking/event-notifications/mssql.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
CREATE TABLE OB_NOTIFICATION ( | ||
NOTIFICATION_ID varchar(36) NOT NULL, | ||
CLIENT_ID varchar(255) NOT NULL, | ||
RESOURCE_ID varchar(255) NOT NULL, | ||
STATUS varchar(10) NOT NULL, | ||
UPDATED_TIMESTAMP DATETIME2(0) DEFAULT GETDATE(), | ||
PRIMARY KEY (NOTIFICATION_ID) | ||
); | ||
|
||
CREATE TABLE OB_NOTIFICATION_EVENT ( | ||
EVENT_ID int NOT NULL IDENTITY, | ||
NOTIFICATION_ID varchar(36) NOT NULL, | ||
EVENT_TYPE varchar(200) NOT NULL, | ||
EVENT_INFO varchar(1000) NOT NULL, | ||
PRIMARY KEY (EVENT_ID), | ||
CONSTRAINT FK_NotificationEvent FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID) | ||
); | ||
|
||
CREATE TABLE OB_NOTIFICATION_ERROR ( | ||
NOTIFICATION_ID varchar(36) NOT NULL, | ||
ERROR_CODE varchar(255) NOT NULL, | ||
DESCRIPTION varchar(255) NOT NULL, | ||
PRIMARY KEY (NOTIFICATION_ID), | ||
CONSTRAINT FK_NotificationError FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID) | ||
); | ||
|
||
CREATE TABLE OB_NOTIFICATION_SUBSCRIPTION ( | ||
SUBSCRIPTION_ID varchar(36) NOT NULL, | ||
CLIENT_ID varchar(255) NOT NULL, | ||
REQUEST JSON NOT NULL, | ||
CALLBACK_URL varchar(255), | ||
TIMESTAMP BIGINT NOT NULL, | ||
SPEC_VERSION varchar(255), | ||
STATUS varchar(255) NOT NULL, | ||
PRIMARY KEY (SUBSCRIPTION_ID) | ||
); | ||
|
||
CREATE TABLE OB_NOTIFICATION_SUBSCRIPTION_EVENTS ( | ||
SUBSCRIPTION_ID varchar(36) NOT NULL, | ||
EVENT_TYPE varchar(255) NOT NULL, | ||
PRIMARY KEY (SUBSCRIPTION_ID, EVENT_TYPE), | ||
CONSTRAINT FK_NotificationSubEvents FOREIGN KEY (SUBSCRIPTION_ID) REFERENCES OB_NOTIFICATION_SUBSCRIPTION(SUBSCRIPTION_ID) | ||
); |
50 changes: 50 additions & 0 deletions
50
...rator/accelerators/ob-is/carbon-home/dbscripts/open-banking/event-notifications/mysql.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
-- For event notifications feature run the following queries against the openbank_openbankingdb-- | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION ( | ||
NOTIFICATION_ID varchar(36) NOT NULL, | ||
CLIENT_ID varchar(255) NOT NULL, | ||
RESOURCE_ID varchar(255) NOT NULL, | ||
STATUS varchar(10) NOT NULL, | ||
UPDATED_TIMESTAMP TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
PRIMARY KEY (NOTIFICATION_ID) | ||
) | ||
ENGINE=InnoDB; | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_EVENT ( | ||
EVENT_ID int(11) NOT NULL AUTO_INCREMENT, | ||
NOTIFICATION_ID varchar(36) NOT NULL, | ||
EVENT_TYPE varchar(200) NOT NULL, | ||
EVENT_INFO varchar(1000) NOT NULL, | ||
PRIMARY KEY (EVENT_ID), | ||
CONSTRAINT FK_NotificationEvent FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID) | ||
) | ||
ENGINE=InnoDB; | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_ERROR ( | ||
NOTIFICATION_ID varchar(36) NOT NULL, | ||
ERROR_CODE varchar(255) NOT NULL, | ||
DESCRIPTION varchar(255) NOT NULL, | ||
PRIMARY KEY (NOTIFICATION_ID), | ||
CONSTRAINT FK_NotificationError FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID) | ||
) | ||
ENGINE=InnoDB; | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_SUBSCRIPTION ( | ||
SUBSCRIPTION_ID varchar(36) NOT NULL, | ||
CLIENT_ID varchar(255) NOT NULL, | ||
REQUEST JSON NOT NULL, | ||
CALLBACK_URL varchar(255), | ||
TIMESTAMP BIGINT NOT NULL, | ||
SPEC_VERSION varchar(255), | ||
STATUS varchar(255) NOT NULL, | ||
PRIMARY KEY (SUBSCRIPTION_ID) | ||
) | ||
ENGINE=InnoDB; | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_SUBSCRIPTION_EVENTS ( | ||
SUBSCRIPTION_ID varchar(36) NOT NULL, | ||
EVENT_TYPE varchar(255) NOT NULL, | ||
PRIMARY KEY (SUBSCRIPTION_ID, EVENT_TYPE), | ||
CONSTRAINT FK_NotificationSubEvents FOREIGN KEY (SUBSCRIPTION_ID) REFERENCES OB_NOTIFICATION_SUBSCRIPTION(SUBSCRIPTION_ID) | ||
) | ||
ENGINE=InnoDB; |
56 changes: 56 additions & 0 deletions
56
...ator/accelerators/ob-is/carbon-home/dbscripts/open-banking/event-notifications/oracle.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
CREATE TABLE OB_NOTIFICATION ( | ||
NOTIFICATION_ID varchar2(36) NOT NULL, | ||
CLIENT_ID varchar2(255) NOT NULL, | ||
RESOURCE_ID varchar2(255) NOT NULL, | ||
STATUS varchar2(10) NOT NULL, | ||
UPDATED_TIMESTAMP TIMESTAMP(0) DEFAULT SYSTIMESTAMP, | ||
PRIMARY KEY (NOTIFICATION_ID) | ||
); | ||
|
||
CREATE TABLE OB_NOTIFICATION_EVENT ( | ||
EVENT_ID number(10) NOT NULL, | ||
NOTIFICATION_ID varchar2(36) NOT NULL, | ||
EVENT_TYPE varchar2(200) NOT NULL, | ||
EVENT_INFO varchar2(1000) NOT NULL, | ||
PRIMARY KEY (EVENT_ID), | ||
CONSTRAINT FK_NotificationEvent FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID) | ||
); | ||
|
||
-- Generate ID using sequence and trigger | ||
CREATE SEQUENCE OB_NOTIFICATION_EVENT_seq START WITH 1 INCREMENT BY 1; | ||
|
||
CREATE OR REPLACE TRIGGER OB_NOTIFICATION_EVENT_seq_tr | ||
BEFORE INSERT ON OB_NOTIFICATION_EVENT FOR EACH ROW | ||
WHEN (NEW.EVENT_ID IS NULL) | ||
BEGIN | ||
SELECT OB_NOTIFICATION_EVENT_seq.NEXTVAL INTO :NEW.EVENT_ID FROM DUAL; | ||
END; | ||
|
||
|
||
CREATE TABLE OB_NOTIFICATION_ERROR ( | ||
NOTIFICATION_ID varchar2(36) NOT NULL, | ||
ERROR_CODE varchar2(255) NOT NULL, | ||
DESCRIPTION varchar2(255) NOT NULL, | ||
PRIMARY KEY (NOTIFICATION_ID), | ||
CONSTRAINT FK_NotificationError FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID) | ||
) | ||
|
||
CREATE TABLE OB_NOTIFICATION_SUBSCRIPTION ( | ||
SUBSCRIPTION_ID varchar(36) NOT NULL, | ||
CLIENT_ID varchar(255) NOT NULL, | ||
REQUEST JSON NOT NULL, | ||
CALLBACK_URL varchar(255), | ||
TIMESTAMP BIGINT NOT NULL, | ||
SPEC_VERSION varchar(255), | ||
STATUS varchar(255) NOT NULL, | ||
PRIMARY KEY (SUBSCRIPTION_ID) | ||
); | ||
|
||
CREATE TABLE OB_NOTIFICATION_SUBSCRIPTION_EVENTS ( | ||
SUBSCRIPTION_ID varchar(36) NOT NULL, | ||
EVENT_TYPE varchar(255) NOT NULL, | ||
PRIMARY KEY (SUBSCRIPTION_ID, EVENT_TYPE), | ||
CONSTRAINT FK_NotificationSubEvents FOREIGN KEY (SUBSCRIPTION_ID) REFERENCES OB_NOTIFICATION_SUBSCRIPTION(SUBSCRIPTION_ID) | ||
); | ||
|
||
|
44 changes: 44 additions & 0 deletions
44
.../accelerators/ob-is/carbon-home/dbscripts/open-banking/event-notifications/postgresql.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
-- For event notifications feature run the following queries against the openbank_openbankingdb-- | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION ( | ||
NOTIFICATION_ID varchar(36) NOT NULL, | ||
CLIENT_ID varchar(255) NOT NULL, | ||
RESOURCE_ID varchar(255) NOT NULL, | ||
STATUS varchar(10) NOT NULL, | ||
UPDATED_TIMESTAMP TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP, | ||
PRIMARY KEY (NOTIFICATION_ID) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_EVENT ( | ||
EVENT_ID SERIAL PRIMARY KEY, | ||
NOTIFICATION_ID varchar(36) NOT NULL, | ||
EVENT_TYPE varchar(200) NOT NULL, | ||
EVENT_INFO varchar(1000) NOT NULL, | ||
CONSTRAINT FK_NotificationEvent FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_ERROR ( | ||
NOTIFICATION_ID varchar(36) NOT NULL, | ||
ERROR_CODE varchar(255) NOT NULL, | ||
DESCRIPTION varchar(255) NOT NULL, | ||
PRIMARY KEY (NOTIFICATION_ID), | ||
CONSTRAINT FK_NotificationError FOREIGN KEY (NOTIFICATION_ID) REFERENCES OB_NOTIFICATION(NOTIFICATION_ID) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_SUBSCRIPTION ( | ||
SUBSCRIPTION_ID varchar(36) NOT NULL, | ||
CLIENT_ID varchar(255) NOT NULL, | ||
REQUEST JSON NOT NULL, | ||
CALLBACK_URL varchar(255), | ||
TIMESTAMP BIGINT NOT NULL, | ||
SPEC_VERSION varchar(255), | ||
STATUS varchar(255) NOT NULL, | ||
PRIMARY KEY (SUBSCRIPTION_ID) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS OB_NOTIFICATION_SUBSCRIPTION_EVENTS ( | ||
SUBSCRIPTION_ID varchar(36) NOT NULL, | ||
EVENT_TYPE varchar(255) NOT NULL, | ||
PRIMARY KEY (SUBSCRIPTION_ID, EVENT_TYPE), | ||
CONSTRAINT FK_NotificationSubEvents FOREIGN KEY (SUBSCRIPTION_ID) REFERENCES OB_NOTIFICATION_SUBSCRIPTION(SUBSCRIPTION_ID) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters