-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOSIP-32075 : DB attributes of PMS are hardcoded in db_scripts (sql s…
…cripts) Signed-off-by: sudeep <[email protected]>
- Loading branch information
1 parent
42d83c3
commit 60b93c8
Showing
9 changed files
with
25 additions
and
26 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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
CREATE DATABASE mosip_pms | ||
CREATE DATABASE :mosipdbname | ||
ENCODING = 'UTF8' | ||
TABLESPACE = pg_default | ||
OWNER = postgres; | ||
|
||
COMMENT ON DATABASE mosip_pms IS 'PMS related entities and its data is stored in this database'; | ||
COMMENT ON DATABASE :mosipdbname IS 'PMS related entities and its data is stored in this database'; | ||
|
||
\c mosip_pms | ||
\c :mosipdbname | ||
|
||
DROP SCHEMA IF EXISTS pms CASCADE; | ||
CREATE SCHEMA pms; | ||
ALTER SCHEMA pms OWNER TO postgres; | ||
ALTER DATABASE mosip_pms SET search_path TO pms,pg_catalog,public; | ||
ALTER DATABASE :mosipdbname SET search_path TO pms,pg_catalog,public; |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
\c mosip_pms | ||
\c :mosipdbname | ||
|
||
\ir ddl/pms-auth_policy.sql | ||
\ir ddl/pms-auth_policy_h.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DROP DATABASE IF EXISTS mosip_pms; | ||
DROP DATABASE IF EXISTS :mosipdbname; | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
drop role if exists pmsuser; | ||
drop role if exists :dbuname; |
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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
\c mosip_pms | ||
\c :mosipdbname | ||
|
||
GRANT CONNECT | ||
ON DATABASE mosip_pms | ||
TO pmsuser; | ||
ON DATABASE :mosipdbname | ||
TO :dbuname; | ||
|
||
GRANT USAGE | ||
ON SCHEMA pms | ||
TO pmsuser; | ||
TO :dbuname; | ||
|
||
GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE,REFERENCES | ||
ON ALL TABLES IN SCHEMA pms | ||
TO pmsuser; | ||
TO :dbuname; | ||
|
||
ALTER DEFAULT PRIVILEGES IN SCHEMA pms | ||
GRANT SELECT,INSERT,UPDATE,DELETE,REFERENCES ON TABLES TO pmsuser; | ||
|
||
GRANT SELECT,INSERT,UPDATE,DELETE,REFERENCES ON TABLES TO :dbuname; |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
CREATE ROLE pmsuser WITH | ||
CREATE ROLE :dbuname WITH | ||
INHERIT | ||
LOGIN | ||
PASSWORD :dbuserpwd; | ||
PASSWORD ':dbuserpwd'; |