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

removed drop table comments in scripts #101

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions db_scripts/mosip_sbitestkit/db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE DATABASE mosip_sbitestkit
ENCODING = 'UTF8'
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'
TABLESPACE = pg_default
OWNER = postgres
TEMPLATE = template0;
COMMENT ON DATABASE mosip_sbitestkit IS 'database to store test runs in sbi test kit';

\c mosip_sbitestkit postgres

DROP SCHEMA IF EXISTS sbitestkit CASCADE;
CREATE SCHEMA sbitestkit;
ALTER SCHEMA sbitestkit OWNER TO postgres;
ALTER DATABASE mosip_sbitestkit SET search_path TO sbitestkit,pg_catalog,public;
64 changes: 64 additions & 0 deletions db_scripts/mosip_sbitestkit/ddl/run_status.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
-- Table: sbitestkit.run_status



CREATE TABLE IF NOT EXISTS sbitestkit.run_status
(
run_id character varying(36) COLLATE pg_catalog."default" NOT NULL,
status character varying(36) COLLATE pg_catalog."default",
profile character varying COLLATE pg_catalog."default",
name character varying COLLATE pg_catalog."default",
owner character varying(36) COLLATE pg_catalog."default" NOT NULL,
cr_by character varying(256) COLLATE pg_catalog."default" NOT NULL,
cr_dtimes timestamp without time zone NOT NULL,
upd_by character varying(256) COLLATE pg_catalog."default",
upd_dtimes timestamp without time zone,
is_deleted boolean,
del_dtimes timestamp without time zone,
CONSTRAINT pk_runsta_id PRIMARY KEY (run_id)
)

TABLESPACE pg_default;

ALTER TABLE sbitestkit.run_status
OWNER to sysadmin;



GRANT ALL ON TABLE sbitestkit.run_status TO sysadmin;

COMMENT ON TABLE sbitestkit.run_status
IS 'Run Status : MDS Validation kit run status details';

COMMENT ON COLUMN sbitestkit.run_status.run_id
IS 'Run ID: Unique run id to identify the run';

COMMENT ON COLUMN sbitestkit.run_status.status
IS 'Status : Run status';

COMMENT ON COLUMN sbitestkit.run_status.profile
IS 'Profile: Profile of the validation kit run';

COMMENT ON COLUMN sbitestkit.run_status.name
IS 'Name: Run name';

COMMENT ON COLUMN sbitestkit.run_status.owner
IS 'Owner: Run owner';

COMMENT ON COLUMN sbitestkit.run_status.cr_by
IS 'Created By : ID or name of the user who create / insert record';

COMMENT ON COLUMN sbitestkit.run_status.cr_dtimes
IS 'Created DateTimestamp : Date and Timestamp when the record is created/inserted';

COMMENT ON COLUMN sbitestkit.run_status.upd_by
IS 'Updated By : ID or name of the user who update the record with new values';

COMMENT ON COLUMN sbitestkit.run_status.upd_dtimes
IS 'Updated DateTimestamp : Date and Timestamp when any of the fields in the record is updated with new values.';

COMMENT ON COLUMN sbitestkit.run_status.is_deleted
IS 'IS_Deleted : Flag to mark whether the record is Soft deleted.';

COMMENT ON COLUMN sbitestkit.run_status.del_dtimes
IS 'Deleted DateTimestamp : Date and Timestamp when the record is soft deleted with is_deleted=TRUE';
88 changes: 88 additions & 0 deletions db_scripts/mosip_sbitestkit/ddl/testcase_result.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
-- Table: sbitestkit.testcase_result



CREATE TABLE IF NOT EXISTS sbitestkit.testcase_result
(
run_id character varying(36) COLLATE pg_catalog."default" NOT NULL,
testcase_name character varying(64) COLLATE pg_catalog."default" NOT NULL,
description character varying(128) COLLATE pg_catalog."default",
owner character varying(36) COLLATE pg_catalog."default" NOT NULL,
request character varying COLLATE pg_catalog."default",
response character varying COLLATE pg_catalog."default",
validation_results character varying COLLATE pg_catalog."default",
passed boolean,
device_info character varying COLLATE pg_catalog."default",
executed_on timestamp without time zone,
current_status character varying(36) COLLATE pg_catalog."default",
cr_by character varying(256) COLLATE pg_catalog."default" NOT NULL,
cr_dtimes timestamp without time zone NOT NULL,
upd_by character varying(256) COLLATE pg_catalog."default",
upd_dtimes timestamp without time zone,
is_deleted boolean,
del_dtimes timestamp without time zone,
CONSTRAINT pk_testr_id PRIMARY KEY (run_id, testcase_name)
)

TABLESPACE pg_default;

ALTER TABLE sbitestkit.testcase_result
OWNER to sysadmin;



GRANT ALL ON TABLE sbitestkit.testcase_result TO sysadmin;

COMMENT ON TABLE sbitestkit.testcase_result
IS 'Test Case Results: Results captured as part of the test';

COMMENT ON COLUMN sbitestkit.testcase_result.run_id
IS 'Run ID: Unique run id to identify the run';

COMMENT ON COLUMN sbitestkit.testcase_result.testcase_name
IS 'Test case Name: Name of the test case';

COMMENT ON COLUMN sbitestkit.testcase_result.description
IS 'Description : Description of test results';

COMMENT ON COLUMN sbitestkit.testcase_result.owner
IS 'Owner: Run owner';

COMMENT ON COLUMN sbitestkit.testcase_result.request
IS 'Request: Test Request';

COMMENT ON COLUMN sbitestkit.testcase_result.response
IS 'Response: Test Response';

COMMENT ON COLUMN sbitestkit.testcase_result.validation_results
IS 'Validation Results: Results of the MDS validations';

COMMENT ON COLUMN sbitestkit.testcase_result.passed
IS 'Passed: Boolean value of the test';

COMMENT ON COLUMN sbitestkit.testcase_result.device_info
IS 'Device Info: Device Information';

COMMENT ON COLUMN sbitestkit.testcase_result.executed_on
IS 'Executed On: Test executed date and time';

COMMENT ON COLUMN sbitestkit.testcase_result.current_status
IS 'Current Status : Current status of the run';

COMMENT ON COLUMN sbitestkit.testcase_result.cr_by
IS 'Created By : ID or name of the user who create / insert record';

COMMENT ON COLUMN sbitestkit.testcase_result.cr_dtimes
IS 'Created DateTimestamp : Date and Timestamp when the record is created/inserted';

COMMENT ON COLUMN sbitestkit.testcase_result.upd_by
IS 'Updated By : ID or name of the user who update the record with new values';

COMMENT ON COLUMN sbitestkit.testcase_result.upd_dtimes
IS 'Updated DateTimestamp : Date and Timestamp when any of the fields in the record is updated with new values.';

COMMENT ON COLUMN sbitestkit.testcase_result.is_deleted
IS 'IS_Deleted : Flag to mark whether the record is Soft deleted.';

COMMENT ON COLUMN sbitestkit.testcase_result.del_dtimes
IS 'Deleted DateTimestamp : Date and Timestamp when the record is soft deleted with is_deleted=TRUE';
23 changes: 23 additions & 0 deletions db_scripts/mosip_sbitestkit/grants.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
\c mosip_sbitestkit

GRANT CONNECT
ON DATABASE mosip_sbitestkit
TO sbitestkituser;
-- ddl-end --

-- object: grant_3543fb6cf7 | type: PERMISSION --

-- object: grant_8e1a2559ed | type: PERMISSION --
GRANT USAGE
ON SCHEMA sbitestkit
TO sbitestkituser;
-- ddl-end --

-- object: grant_8e1a2559ed | type: PERMISSION --
GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE,REFERENCES
ON ALL TABLES IN SCHEMA sbitestkit
TO sbitestkituser;
-- ddl-end --

ALTER DEFAULT PRIVILEGES IN SCHEMA sbitestkit
GRANT SELECT,INSERT,UPDATE,DELETE,REFERENCES ON TABLES TO sbitestkituser;
17 changes: 17 additions & 0 deletions db_scripts/mosip_sbitestkit/role_dbuser.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- object: sbitestkituser | type: ROLE --

CREATE ROLE sbitestkituser WITH
INHERIT
LOGIN
PASSWORD :dbuserpwd;

-- ddl-end --

CREATE ROLE sysadmin WITH
SUPERUSER
CREATEDB
CREATEROLE
INHERIT
LOGIN
REPLICATION
PASSWORD :sysadminpwd;