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

Fix account metadata dbscript issues #26

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
*/

--For account metadata feature run the following queries against the openbank_openbankingdb--
CREATE TABLE IF NOT EXISTS OB_ACCOUNT_METADATA (
ACCOUNT_ID VARCHAR(100) NOT NULL,
USER_ID VARCHAR(100) NOT NULL,
METADATA_KEY VARCHAR(100) NOT NULL,
METADATA_VALUE VARCHAR(100) NOT NULL,
LAST_UPDATE_TIMESTAMP DATETIME NOT NULL DEFAULT getdate(),
PRIMARY KEY (USER_ID,ACCOUNT_ID,METADATA_KEY)
);
IF OBJECT_ID('dbo.OB_ACCOUNT_METADATA', 'U') IS NULL
BEGIN
CREATE TABLE dbo.OB_ACCOUNT_METADATA
(
ACCOUNT_ID varchar(100) NOT NULL,
USER_ID varchar(100) NOT NULL,
METADATA_KEY varchar(100) NOT NULL,
METADATA_VALUE varchar(100) NOT NULL,
LAST_UPDATED_TIMESTAMP timestamp NOT NULL,
CONSTRAINT OB_ACCOUNT_USER_ATTRIBUTE_PK PRIMARY KEY (USER_ID,ACCOUNT_ID,METADATA_KEY)
)
END;
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ CREATE TABLE IF NOT EXISTS OB_ACCOUNT_METADATA (
USER_ID varchar(100) NOT NULL,
METADATA_KEY varchar(100) NOT NULL,
METADATA_VALUE varchar(100) NOT NULL,
LAST_UPDATE_TIMESTAMP timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
LAST_UPDATED_TIMESTAMP timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (USER_ID,ACCOUNT_ID,METADATA_KEY)
);
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ CREATE TABLE IF NOT EXISTS OB_ACCOUNT_METADATA (
USER_ID varchar(100) NOT NULL,
METADATA_KEY varchar(100) NOT NULL,
METADATA_VALUE varchar(100) NOT NULL,
LAST_UPDATE_TIMESTAMP TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (USER_ID,ACCOUNT_ID,METADATA_KEY)
);
Loading