Adding db infrastructure setup
This commit is contained in:
parent
7dae58ec1e
commit
58bf4bea00
11 changed files with 125 additions and 6 deletions
1
SqlManagement/.dbeaver/.project-metadata.json.bak
Normal file
1
SqlManagement/.dbeaver/.project-metadata.json.bak
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"resources":{"Scripts/grant-privileges.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptdb01"}}}
|
||||
1
SqlManagement/.dbeaver/project-metadata.json
Normal file
1
SqlManagement/.dbeaver/project-metadata.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"resources":{"Scripts/Script-2.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptdb01"},"Scripts/grant-privileges.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptdb01"}}}
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
GRANT USAGE, CREATE ON SCHEMA swp TO sathumper;
|
||||
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA swp
|
||||
|
|
|
|||
45
SqlManagement/Scripts/grant-privileges.sql
Normal file
45
SqlManagement/Scripts/grant-privileges.sql
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
CREATE ROLE sathumper WITH
|
||||
CREATEROLE
|
||||
CREATEDB
|
||||
LOGIN
|
||||
PASSWORD '3911';
|
||||
|
||||
CREATE SCHEMA ptmain;
|
||||
GRANT USAGE, CREATE ON SCHEMA ptmain TO sathumper;
|
||||
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA ptmain TO sathumper;
|
||||
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA ptmain TO sathumper;
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA ptmain
|
||||
GRANT ALL PRIVILEGES ON TABLES TO sathumper;
|
||||
|
||||
|
||||
-- prod.app_configuration definition
|
||||
|
||||
-- Drop table
|
||||
|
||||
-- DROP TABLE prod.app_configuration;
|
||||
|
||||
CREATE TABLE prod.app_configuration (
|
||||
|
||||
id bigserial NOT NULL,
|
||||
|
||||
"key" varchar(255) NOT NULL,
|
||||
|
||||
value text NULL,
|
||||
|
||||
"label" varchar(255) NULL,
|
||||
|
||||
content_type varchar(255) DEFAULT 'text/plain'::character varying NULL,
|
||||
|
||||
expires_at timestamptz NULL,
|
||||
|
||||
created_at timestamptz DEFAULT CURRENT_TIMESTAMP NULL,
|
||||
|
||||
modified_at timestamptz DEFAULT CURRENT_TIMESTAMP NULL,
|
||||
|
||||
etag uuid DEFAULT gen_random_uuid() NULL,
|
||||
|
||||
CONSTRAINT app_configuration_pkey PRIMARY KEY (id)
|
||||
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX idx_prod_unique_key_label ON prod.app_configuration USING btree (key, COALESCE(label, ''::character varying));
|
||||
Loading…
Add table
Add a link
Reference in a new issue