WIP
This commit is contained in:
parent
54b057886c
commit
7fc1ae0650
204 changed files with 4345 additions and 134 deletions
|
|
@ -0,0 +1,3 @@
|
|||
ç¡#øÏJqe0ó|/bêoK,/=Rùi^kå<EFBFBD>@µÐ7Àg§<EFBFBD>¿õ±¬t`‚YþBœ¢J$‡a›0:°Ð¨ýQuåHÛÖO¾ÀC]š”£î`˜ .GHçC¶±#"Ïæ¤Î\Eáþ%vq`y
|
||||
Ñ‚z¶„réO›hÂüºÓJq»<EFBFBD>†9Ÿ¢'.ÀH„ak”à¤ólS¬ÿ%£çxˆb%»Ï†<EFBFBD>
]Ö˜›«L4U³2GÇ:ßá'°_~cÑ<EFBFBD>¾>(ã7
|
||||
"R.ñn¯Ù=̓l¢W÷>1F¤1{
|
||||
89
PlanTempus.SqlManagement/.dbeaver/.data-sources.json.bak
Normal file
89
PlanTempus.SqlManagement/.dbeaver/.data-sources.json.bak
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
"folders": {},
|
||||
"connections": {
|
||||
"postgres-jdbc-1948450a8b4-5fc9eec404e65c44": {
|
||||
"provider": "postgresql",
|
||||
"driver": "postgres-jdbc",
|
||||
"name": "UB-KK01-postgres",
|
||||
"save-password": true,
|
||||
"configuration": {
|
||||
"host": "192.168.1.57",
|
||||
"port": "5432",
|
||||
"database": "ptmain",
|
||||
"url": "jdbc:postgresql://192.168.1.57:5432/ptmain",
|
||||
"configurationType": "MANUAL",
|
||||
"home": "postgresql_client",
|
||||
"type": "dev",
|
||||
"closeIdleConnection": true,
|
||||
"properties": {
|
||||
"connectTimeout": "20",
|
||||
"loginTimeout": "20",
|
||||
"escapeSyntaxCallMode": "callIfNoReturn"
|
||||
},
|
||||
"provider-properties": {
|
||||
"@dbeaver-show-non-default-db@": "true",
|
||||
"@dbeaver-chosen-role@": "",
|
||||
"@dbeaver-show-template-db@": "false",
|
||||
"@dbeaver-show-unavailable-db@": "false",
|
||||
"show-database-statistics": "false",
|
||||
"@dbeaver-read-all-data-types-db@": "false",
|
||||
"read-keys-with-columns": "false",
|
||||
"@dbeaver-use-prepared-statements-db@": "false",
|
||||
"postgresql.dd.plain.string": "false",
|
||||
"postgresql.dd.tag.string": "false"
|
||||
},
|
||||
"auth-model": "native"
|
||||
}
|
||||
},
|
||||
"postgres-jdbc-195383ce5c3-68a4eee43daef302": {
|
||||
"provider": "postgresql",
|
||||
"driver": "postgres-jdbc",
|
||||
"name": "UB-KK01-postgres 1",
|
||||
"save-password": true,
|
||||
"configuration": {
|
||||
"host": "192.168.1.57",
|
||||
"port": "5432",
|
||||
"database": "ptmain",
|
||||
"url": "jdbc:postgresql://192.168.1.57:5432/ptmain",
|
||||
"configurationType": "MANUAL",
|
||||
"home": "postgresql_client",
|
||||
"type": "dev",
|
||||
"closeIdleConnection": true,
|
||||
"properties": {
|
||||
"connectTimeout": "20",
|
||||
"loginTimeout": "20",
|
||||
"escapeSyntaxCallMode": "callIfNoReturn"
|
||||
},
|
||||
"provider-properties": {
|
||||
"@dbeaver-show-non-default-db@": "true",
|
||||
"@dbeaver-chosen-role@": "",
|
||||
"@dbeaver-show-template-db@": "false",
|
||||
"@dbeaver-show-unavailable-db@": "false",
|
||||
"show-database-statistics": "false",
|
||||
"@dbeaver-read-all-data-types-db@": "false",
|
||||
"read-keys-with-columns": "false",
|
||||
"@dbeaver-use-prepared-statements-db@": "false",
|
||||
"postgresql.dd.plain.string": "false",
|
||||
"postgresql.dd.tag.string": "false"
|
||||
},
|
||||
"auth-model": "native"
|
||||
}
|
||||
}
|
||||
},
|
||||
"connection-types": {
|
||||
"dev": {
|
||||
"name": "Development",
|
||||
"color": "255,255,255",
|
||||
"description": "Regular development database",
|
||||
"auto-commit": true,
|
||||
"confirm-execute": false,
|
||||
"confirm-data-change": false,
|
||||
"smart-commit": false,
|
||||
"smart-commit-recover": true,
|
||||
"auto-close-transactions": true,
|
||||
"close-transactions-period": 1800,
|
||||
"auto-close-connections": true,
|
||||
"close-connections-period": 14400
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"resources":{"Scripts/Script-1.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"sandbox"},"Scripts/Script.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"},"Scripts/SmartConfigSystem.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptdb01"},"Scripts/grant-privileges.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"}}}
|
||||
BIN
PlanTempus.SqlManagement/.dbeaver/credentials-config.json
Normal file
BIN
PlanTempus.SqlManagement/.dbeaver/credentials-config.json
Normal file
Binary file not shown.
89
PlanTempus.SqlManagement/.dbeaver/data-sources.json
Normal file
89
PlanTempus.SqlManagement/.dbeaver/data-sources.json
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
"folders": {},
|
||||
"connections": {
|
||||
"postgres-jdbc-1948450a8b4-5fc9eec404e65c44": {
|
||||
"provider": "postgresql",
|
||||
"driver": "postgres-jdbc",
|
||||
"name": "UB-KK01-postgres",
|
||||
"save-password": true,
|
||||
"configuration": {
|
||||
"host": "192.168.1.57",
|
||||
"port": "5432",
|
||||
"database": "ptmain",
|
||||
"url": "jdbc:postgresql://192.168.1.57:5432/ptmain",
|
||||
"configurationType": "MANUAL",
|
||||
"home": "postgresql_client",
|
||||
"type": "dev",
|
||||
"closeIdleConnection": true,
|
||||
"properties": {
|
||||
"connectTimeout": "20",
|
||||
"loginTimeout": "20",
|
||||
"escapeSyntaxCallMode": "callIfNoReturn"
|
||||
},
|
||||
"provider-properties": {
|
||||
"@dbeaver-show-non-default-db@": "true",
|
||||
"@dbeaver-chosen-role@": "",
|
||||
"@dbeaver-show-template-db@": "false",
|
||||
"@dbeaver-show-unavailable-db@": "false",
|
||||
"show-database-statistics": "false",
|
||||
"@dbeaver-read-all-data-types-db@": "false",
|
||||
"read-keys-with-columns": "false",
|
||||
"@dbeaver-use-prepared-statements-db@": "false",
|
||||
"postgresql.dd.plain.string": "false",
|
||||
"postgresql.dd.tag.string": "false"
|
||||
},
|
||||
"auth-model": "native"
|
||||
}
|
||||
},
|
||||
"postgres-jdbc-195383ce5c3-68a4eee43daef302": {
|
||||
"provider": "postgresql",
|
||||
"driver": "postgres-jdbc",
|
||||
"name": "UB-KK01-sathumper",
|
||||
"save-password": true,
|
||||
"configuration": {
|
||||
"host": "192.168.1.57",
|
||||
"port": "5432",
|
||||
"database": "ptmain",
|
||||
"url": "jdbc:postgresql://192.168.1.57:5432/ptmain",
|
||||
"configurationType": "MANUAL",
|
||||
"home": "postgresql_client",
|
||||
"type": "dev",
|
||||
"closeIdleConnection": true,
|
||||
"properties": {
|
||||
"connectTimeout": "20",
|
||||
"loginTimeout": "20",
|
||||
"escapeSyntaxCallMode": "callIfNoReturn"
|
||||
},
|
||||
"provider-properties": {
|
||||
"@dbeaver-show-non-default-db@": "true",
|
||||
"@dbeaver-chosen-role@": "",
|
||||
"@dbeaver-show-template-db@": "false",
|
||||
"@dbeaver-show-unavailable-db@": "false",
|
||||
"show-database-statistics": "false",
|
||||
"@dbeaver-read-all-data-types-db@": "false",
|
||||
"read-keys-with-columns": "false",
|
||||
"@dbeaver-use-prepared-statements-db@": "false",
|
||||
"postgresql.dd.plain.string": "false",
|
||||
"postgresql.dd.tag.string": "false"
|
||||
},
|
||||
"auth-model": "native"
|
||||
}
|
||||
}
|
||||
},
|
||||
"connection-types": {
|
||||
"dev": {
|
||||
"name": "Development",
|
||||
"color": "255,255,255",
|
||||
"description": "Regular development database",
|
||||
"auto-commit": true,
|
||||
"confirm-execute": false,
|
||||
"confirm-data-change": false,
|
||||
"smart-commit": false,
|
||||
"smart-commit-recover": true,
|
||||
"auto-close-transactions": true,
|
||||
"close-transactions-period": 1800,
|
||||
"auto-close-connections": true,
|
||||
"close-connections-period": 14400
|
||||
}
|
||||
}
|
||||
}
|
||||
1
PlanTempus.SqlManagement/.dbeaver/project-metadata.json
Normal file
1
PlanTempus.SqlManagement/.dbeaver/project-metadata.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"resources":{"Scripts/Script-1.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"sandbox"},"Scripts/Script.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"},"Scripts/SmartConfigSystem.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptdb01"},"Scripts/grant-privileges.sql":{"default-datasource":"postgres-jdbc-1948450a8b4-5fc9eec404e65c44","default-catalog":"ptmain"}}}
|
||||
1
PlanTempus.SqlManagement/.dbeaver/project-settings.json
Normal file
1
PlanTempus.SqlManagement/.dbeaver/project-settings.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"id":"830a3048-5c54-4a87-8ff6-d6cb932e9704"}
|
||||
12
PlanTempus.SqlManagement/.project
Normal file
12
PlanTempus.SqlManagement/.project
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>PlanTempus</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.jkiss.dbeaver.DBeaverNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
2
PlanTempus.SqlManagement/Dashboards/Test.dashboard
Normal file
2
PlanTempus.SqlManagement/Dashboards/Test.dashboard
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dashboardList/>
|
||||
30
PlanTempus.SqlManagement/Diagrams/global.erd
Normal file
30
PlanTempus.SqlManagement/Diagrams/global.erd
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<<<<<<< HEAD
|
||||
<diagram version="1" name="global.erd">
|
||||
<entities>
|
||||
<data-source id="postgres-jdbc-1948450a8b4-5fc9eec404e65c44">
|
||||
<entity id="1" name="tenants" fq-name="swp.tenants" order="0" x="135" y="211">
|
||||
<path name="swp"/>
|
||||
<path name="ptdb01"/>
|
||||
</entity>
|
||||
<entity id="2" name="user_tenants" fq-name="swp.user_tenants" order="1" x="409" y="83">
|
||||
<path name="swp"/>
|
||||
<path name="ptdb01"/>
|
||||
</entity>
|
||||
<entity id="3" name="users" fq-name="swp.users" order="2" x="670" y="288">
|
||||
<path name="swp"/>
|
||||
<path name="ptdb01"/>
|
||||
</entity>
|
||||
</data-source>
|
||||
</entities>
|
||||
<relations>
|
||||
<relation name="user_tenants_tenant_id_fkey" fq-name="swp.user_tenants.user_tenants_tenant_id_fkey" type="fk" pk-ref="1" fk-ref="2"/>
|
||||
<relation name="tenants_created_by_fkey" fq-name="swp.tenants.tenants_created_by_fkey" type="fk" pk-ref="3" fk-ref="1"/>
|
||||
<relation name="user_tenants_user_id_fkey" fq-name="swp.user_tenants.user_tenants_user_id_fkey" type="fk" pk-ref="3" fk-ref="2"/>
|
||||
</relations>
|
||||
=======
|
||||
<diagram version="1" name="global">
|
||||
<entities/>
|
||||
<relations/>
|
||||
>>>>>>> origin/main
|
||||
</diagram>
|
||||
41
PlanTempus.SqlManagement/Scripts/Script.sql
Normal file
41
PlanTempus.SqlManagement/Scripts/Script.sql
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
GRANT USAGE ON SCHEMA "system" TO heimdall;
|
||||
GRANT CREATE ON SCHEMA "system" TO heimdall
|
||||
|
||||
create schema "system"
|
||||
|
||||
ALTER DEFAULT PRIVILEGES FOR ROLE heimdall IN SCHEMA "system"
|
||||
GRANT ALL PRIVILEGES ON TABLES TO heimdall;
|
||||
|
||||
-- Og for eksisterende tabeller
|
||||
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA "system" TO heimdall;
|
||||
|
||||
ALTER TABLE susers OWNER TO db_admin;
|
||||
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA your_schema TO sathumper;
|
||||
|
||||
|
||||
CREATE ROLE heimdall WITH LOGIN PASSWORD '3911';
|
||||
COMMENT ON ROLE heimdall IS 'Security auditor and guardian';
|
||||
drop role heimdall
|
||||
|
||||
|
||||
set role 'heimdall'
|
||||
ALTER ROLE heimdall SET search_path = "system"
|
||||
drop table system.foo
|
||||
|
||||
SELECT CURRENT_ROLE;
|
||||
SELECT rolname FROM pg_roles
|
||||
select system_user()
|
||||
|
||||
SET ROLE heimdall;
|
||||
RESET ALL; -- Nulstil alle sessionsvariabler til deres standardværdier
|
||||
SHOW search_path; -- Burde nu vise den konfigurerede værdi
|
||||
|
||||
SHOW search_path;
|
||||
|
||||
create table system.foos(id int)
|
||||
|
||||
select * from system.foo
|
||||
select * from "system".organizations
|
||||
|
||||
|
||||
4
PlanTempus.SqlManagement/Scripts/SmartConfigSystem.sql
Normal file
4
PlanTempus.SqlManagement/Scripts/SmartConfigSystem.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
SELECT substring(datname, 5)::integer as dbnumber
|
||||
FROM pg_database
|
||||
WHERE datname LIKE 'ptdb%'
|
||||
ORDER BY dbnumber DESC
|
||||
24
PlanTempus.SqlManagement/Scripts/grant-privileges.sql
Normal file
24
PlanTempus.SqlManagement/Scripts/grant-privileges.sql
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
CREATE ROLE sathumper WITH
|
||||
CREATEROLE
|
||||
CREATEDB
|
||||
LOGIN
|
||||
PASSWORD '3911';
|
||||
|
||||
CREATE SCHEMA "system";
|
||||
GRANT USAGE, CREATE ON SCHEMA "system" TO sathumper;
|
||||
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA "system" TO sathumper;
|
||||
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA "system" TO sathumper;
|
||||
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA "system"
|
||||
GRANT ALL PRIVILEGES ON TABLES TO sathumper;
|
||||
|
||||
SELECT usename, useconfig
|
||||
FROM pg_user
|
||||
WHERE useconfig IS NOT NULL
|
||||
AND useconfig::text LIKE '%search_path%'
|
||||
|
||||
|
||||
ALTER ROLE sathumper1 SET search_path='ss32'
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue