-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from shreelakshmijoshi/adding-immudb-schema
Add immudb schema
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
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,62 @@ | ||
--- | ||
--- creating immudb audit tables | ||
--- | ||
|
||
|
||
--- | ||
--- auditing_dmp | ||
--- | ||
CREATE TABLE auditing_dmp(_id VARCHAR[128] NOT NULL,user_id VARCHAR[128] NOT NULL,api VARCHAR[128] NOT NULL,method VARCHAR[32] NOT NULL,info VARCHAR[1024] NOT NULL, epoch_time INTEGER NOT NULL, iso_time VARCHAR[64] NOT NULL, PRIMARY KEY _id); | ||
|
||
|
||
--- | ||
--- auditing_consent | ||
--- | ||
create table auditing_consent (_id varchar[128] not null,item_id varchar[256] not null,item_type varchar[128] not null,event varchar[256] not null,aiu_id varchar[128] not null,aip_id varchar[256] not null,dp_id varchar[128] not null,isotime varchar[128] not null,artifact varchar[128] not null,shalog varchar[2046] not null,primary key _id); | ||
--- | ||
--- auditing_acl_apd | ||
-- This is not the current schema used in Dev instance of immudb, to create | ||
-- this schema, data from the old table could be migrated here | ||
--- | ||
CREATE TABLE auditing_acl_apd(id VARCHAR[256] NOT NULL, userid VARCHAR[128] NOT NULL,endpoint VARCHAR[128] NOT NULL,method VARCHAR[128] NOT NULL,body VARCHAR[2048] NOT NULL,size INTEGER NOT NULL,isotime VARCHAR[128] NOT NULL,epochtime INTEGER NOT NULL,PRIMARY KEY id); | ||
|
||
--- | ||
--- rsaudit | ||
--- | ||
CREATE TABLE rsaudit (id VARCHAR[128] PRIMARY KEY, api VARCHAR[128] NOT NULL, userid VARCHAR[128] NOT NULL, epochtime INTEGER NOT NULL, resourceid VARCHAR[256] NOT NULL, isotime VARCHAR[64] NOT NULL, providerid VARCHAR[128] NOT NULL, size INTEGER); | ||
|
||
--- | ||
--- auditingtable | ||
--- | ||
CREATE TABLE auditingtable (id VARCHAR[128] PRIMARY KEY, userrole VARCHAR[64] NOT NULL, userid VARCHAR[128] NOT NULL, iid VARCHAR[250] NOT NULL, api VARCHAR[128] NOT NULL, method VARCHAR[32] NOT NULL, time INTEGER NOT NULL, iudxid VARCHAR[256] NOT NULL); | ||
|
||
|
||
--- | ||
--- creating index for the tables | ||
--- | ||
|
||
--- | ||
--- auditing_dmp | ||
--- | ||
CREATE INDEX IF NOT EXISTS ON auditing_dmp(api, method, user_id, epoch_time); | ||
|
||
--- | ||
--- auditing_acl_apd | ||
--- | ||
CREATE INDEX IF NOT EXISTS ON auditing_acl(endpoint, method, userid, epochtime); | ||
|
||
--- | ||
--- rsaudit | ||
--- | ||
CREATE INDEX IF NOT EXISTS index_name ON rsaudit(userid, providerid); | ||
|
||
|
||
--- | ||
--- auditingtable | ||
--- | ||
CREATE INDEX IF NOT EXISTS index_name ON auditingtable(userid, api); | ||
|
||
--- | ||
--- auditing_consent | ||
--- | ||
CREATE INDEX IF NOT EXISTS ON auditing_consent(item_id, aiu_id, dp_id); |