@pgpm/metaschema-modules 0.28.5 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deploy/schemas/metaschema_modules_public/tables/config_secrets_module/table.sql +6 -9
- package/deploy/schemas/metaschema_modules_public/tables/config_secrets_user_module/table.sql +1 -6
- package/deploy/schemas/metaschema_modules_public/tables/entity_type_provision/table.sql +0 -2
- package/deploy/schemas/metaschema_modules_public/tables/function_deployment_module/table.sql +2 -2
- package/deploy/schemas/metaschema_modules_public/tables/function_invocation_module/table.sql +2 -2
- package/deploy/schemas/metaschema_modules_public/tables/function_module/table.sql +3 -6
- package/deploy/schemas/metaschema_modules_public/tables/graph_execution_module/table.sql +2 -2
- package/deploy/schemas/metaschema_modules_public/tables/identity_providers_module/table.sql +7 -7
- package/deploy/schemas/metaschema_modules_public/tables/namespace_module/table.sql +2 -8
- package/deploy/schemas/metaschema_modules_public/tables/resource_module/table.sql +76 -0
- package/package.json +4 -4
- package/pgpm.plan +1 -5
- package/revert/schemas/metaschema_modules_public/tables/resource_module/table.sql +7 -0
- package/sql/metaschema-modules--0.15.5.sql +253 -442
- package/verify/schemas/metaschema_modules_public/tables/resource_module/table.sql +13 -0
- package/deploy/schemas/metaschema_modules_public/tables/certificate_module/table.sql +0 -66
- package/deploy/schemas/metaschema_modules_public/tables/config_secrets_org_module/table.sql +0 -32
- package/deploy/schemas/metaschema_modules_public/tables/route_module/table.sql +0 -63
- package/deploy/schemas/metaschema_modules_public/tables/server_definition_module/table.sql +0 -70
- package/deploy/schemas/metaschema_modules_public/tables/server_deployment_module/table.sql +0 -83
- package/revert/schemas/metaschema_modules_public/tables/certificate_module/table.sql +0 -7
- package/revert/schemas/metaschema_modules_public/tables/config_secrets_org_module/table.sql +0 -7
- package/revert/schemas/metaschema_modules_public/tables/route_module/table.sql +0 -7
- package/revert/schemas/metaschema_modules_public/tables/server_definition_module/table.sql +0 -7
- package/revert/schemas/metaschema_modules_public/tables/server_deployment_module/table.sql +0 -7
- package/verify/schemas/metaschema_modules_public/tables/certificate_module/table.sql +0 -7
- package/verify/schemas/metaschema_modules_public/tables/config_secrets_org_module/table.sql +0 -5
- package/verify/schemas/metaschema_modules_public/tables/route_module/table.sql +0 -7
- package/verify/schemas/metaschema_modules_public/tables/server_definition_module/table.sql +0 -7
- package/verify/schemas/metaschema_modules_public/tables/server_deployment_module/table.sql +0 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- Verify schemas/metaschema_modules_public/tables/resource_module/table on pg
|
|
2
|
+
|
|
3
|
+
BEGIN;
|
|
4
|
+
|
|
5
|
+
SELECT id, database_id, schema_id, private_schema_id,
|
|
6
|
+
resources_table_id, resource_events_table_id,
|
|
7
|
+
resources_table_name, resource_events_table_name,
|
|
8
|
+
scope, prefix, entity_table_id, namespace_module_id,
|
|
9
|
+
policies, provisions, default_permissions
|
|
10
|
+
FROM metaschema_modules_public.resource_module
|
|
11
|
+
WHERE FALSE;
|
|
12
|
+
|
|
13
|
+
ROLLBACK;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
-- Deploy schemas/metaschema_modules_public/tables/certificate_module/table to pg
|
|
2
|
-
|
|
3
|
-
-- requires: schemas/metaschema_modules_public/schema
|
|
4
|
-
|
|
5
|
-
BEGIN;
|
|
6
|
-
|
|
7
|
-
CREATE TABLE metaschema_modules_public.certificate_module (
|
|
8
|
-
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
9
|
-
database_id uuid NOT NULL,
|
|
10
|
-
|
|
11
|
-
-- Schema references (if uuid_nil, resolved from schema name or default)
|
|
12
|
-
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
13
|
-
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
14
|
-
|
|
15
|
-
-- Optional schema name overrides (used when schema IDs are not provided)
|
|
16
|
-
public_schema_name text,
|
|
17
|
-
private_schema_name text,
|
|
18
|
-
|
|
19
|
-
-- Generated table IDs (populated by the generator)
|
|
20
|
-
certificates_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
21
|
-
certificate_domains_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
22
|
-
certificate_events_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
23
|
-
|
|
24
|
-
-- Table names (input to the generator — bare names without scope prefix).
|
|
25
|
-
certificates_table_name text NOT NULL DEFAULT 'certificates',
|
|
26
|
-
certificate_domains_table_name text NOT NULL DEFAULT 'certificate_domains',
|
|
27
|
-
certificate_events_table_name text NOT NULL DEFAULT 'certificate_events',
|
|
28
|
-
|
|
29
|
-
-- API routing (get-or-create: if set, schema is added to this API; if NULL, no API is added)
|
|
30
|
-
api_name text,
|
|
31
|
-
private_api_name text,
|
|
32
|
-
|
|
33
|
-
-- Scope: determines the security level for this module instance.
|
|
34
|
-
scope text NOT NULL DEFAULT 'platform',
|
|
35
|
-
|
|
36
|
-
-- Table name prefix. Auto-derived from scope by the trigger when empty.
|
|
37
|
-
prefix text NOT NULL DEFAULT '',
|
|
38
|
-
|
|
39
|
-
-- Entity table for RLS
|
|
40
|
-
entity_table_id uuid NULL,
|
|
41
|
-
|
|
42
|
-
-- Configurable security policies (NULL = use defaults based on scope).
|
|
43
|
-
policies jsonb NULL,
|
|
44
|
-
|
|
45
|
-
-- Per-table provisions overrides from blueprint config.
|
|
46
|
-
provisions jsonb NULL,
|
|
47
|
-
|
|
48
|
-
-- Default permissions: permission names auto-granted to new members.
|
|
49
|
-
default_permissions text[] DEFAULT NULL,
|
|
50
|
-
|
|
51
|
-
-- Constraints
|
|
52
|
-
CONSTRAINT certificate_module_db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
|
|
53
|
-
CONSTRAINT certificate_module_schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
54
|
-
CONSTRAINT certificate_module_private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
55
|
-
CONSTRAINT certificate_module_certs_table_fkey FOREIGN KEY (certificates_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
56
|
-
CONSTRAINT certificate_module_cert_domains_table_fkey FOREIGN KEY (certificate_domains_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
57
|
-
CONSTRAINT certificate_module_events_table_fkey FOREIGN KEY (certificate_events_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
58
|
-
CONSTRAINT certificate_module_entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
CREATE INDEX certificate_module_database_id_idx ON metaschema_modules_public.certificate_module ( database_id );
|
|
62
|
-
|
|
63
|
-
-- Unique constraint: one certificate module per database per scope per prefix.
|
|
64
|
-
CREATE UNIQUE INDEX certificate_module_unique_scope ON metaschema_modules_public.certificate_module ( database_id, scope, prefix );
|
|
65
|
-
|
|
66
|
-
COMMIT;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
-- Deploy schemas/metaschema_modules_public/tables/config_secrets_org_module/table to pg
|
|
2
|
-
|
|
3
|
-
-- requires: schemas/metaschema_modules_public/schema
|
|
4
|
-
|
|
5
|
-
BEGIN;
|
|
6
|
-
|
|
7
|
-
CREATE TABLE metaschema_modules_public.config_secrets_org_module (
|
|
8
|
-
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
9
|
-
database_id uuid NOT NULL,
|
|
10
|
-
|
|
11
|
-
--
|
|
12
|
-
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
13
|
-
table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
14
|
-
table_name text NOT NULL DEFAULT 'org_secrets',
|
|
15
|
-
--
|
|
16
|
-
|
|
17
|
-
-- API routing (configurable per-module)
|
|
18
|
-
api_name text DEFAULT 'config',
|
|
19
|
-
private_api_name text DEFAULT NULL,
|
|
20
|
-
|
|
21
|
-
CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
|
|
22
|
-
CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
23
|
-
CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
CREATE INDEX config_secrets_org_module_database_id_idx ON metaschema_modules_public.config_secrets_org_module ( database_id );
|
|
27
|
-
CREATE INDEX config_secrets_org_module_schema_id_idx ON metaschema_modules_public.config_secrets_org_module ( schema_id );
|
|
28
|
-
CREATE INDEX config_secrets_org_module_table_id_idx ON metaschema_modules_public.config_secrets_org_module ( table_id );
|
|
29
|
-
|
|
30
|
-
COMMENT ON TABLE metaschema_modules_public.config_secrets_org_module IS 'Config row for the config_secrets_org_module, which provisions an organization-scoped encrypted key-value secrets store with manage_secrets permission and entity-membership RLS.';
|
|
31
|
-
|
|
32
|
-
COMMIT;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
-- Deploy schemas/metaschema_modules_public/tables/route_module/table to pg
|
|
2
|
-
|
|
3
|
-
-- requires: schemas/metaschema_modules_public/schema
|
|
4
|
-
|
|
5
|
-
BEGIN;
|
|
6
|
-
|
|
7
|
-
CREATE TABLE metaschema_modules_public.route_module (
|
|
8
|
-
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
9
|
-
database_id uuid NOT NULL,
|
|
10
|
-
|
|
11
|
-
-- Schema references (if uuid_nil, resolved from schema name or default)
|
|
12
|
-
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
13
|
-
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
14
|
-
|
|
15
|
-
-- Optional schema name overrides (used when schema IDs are not provided)
|
|
16
|
-
public_schema_name text,
|
|
17
|
-
private_schema_name text,
|
|
18
|
-
|
|
19
|
-
-- Generated table IDs (populated by the generator)
|
|
20
|
-
routes_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
21
|
-
route_events_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
22
|
-
|
|
23
|
-
-- Table names (input to the generator — bare names without scope prefix).
|
|
24
|
-
routes_table_name text NOT NULL DEFAULT 'routes',
|
|
25
|
-
route_events_table_name text NOT NULL DEFAULT 'route_events',
|
|
26
|
-
|
|
27
|
-
-- API routing (get-or-create: if set, schema is added to this API; if NULL, no API is added)
|
|
28
|
-
api_name text,
|
|
29
|
-
private_api_name text,
|
|
30
|
-
|
|
31
|
-
-- Scope: determines the security level for this module instance.
|
|
32
|
-
scope text NOT NULL DEFAULT 'platform',
|
|
33
|
-
|
|
34
|
-
-- Table name prefix. Auto-derived from scope by the trigger when empty.
|
|
35
|
-
prefix text NOT NULL DEFAULT '',
|
|
36
|
-
|
|
37
|
-
-- Entity table for RLS
|
|
38
|
-
entity_table_id uuid NULL,
|
|
39
|
-
|
|
40
|
-
-- Configurable security policies (NULL = use defaults based on scope).
|
|
41
|
-
policies jsonb NULL,
|
|
42
|
-
|
|
43
|
-
-- Per-table provisions overrides from blueprint config.
|
|
44
|
-
provisions jsonb NULL,
|
|
45
|
-
|
|
46
|
-
-- Default permissions: permission names auto-granted to new members.
|
|
47
|
-
default_permissions text[] DEFAULT NULL,
|
|
48
|
-
|
|
49
|
-
-- Constraints
|
|
50
|
-
CONSTRAINT route_module_db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
|
|
51
|
-
CONSTRAINT route_module_schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
52
|
-
CONSTRAINT route_module_private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
53
|
-
CONSTRAINT route_module_routes_table_fkey FOREIGN KEY (routes_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
54
|
-
CONSTRAINT route_module_events_table_fkey FOREIGN KEY (route_events_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
55
|
-
CONSTRAINT route_module_entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
CREATE INDEX route_module_database_id_idx ON metaschema_modules_public.route_module ( database_id );
|
|
59
|
-
|
|
60
|
-
-- Unique constraint: one route module per database per scope per prefix.
|
|
61
|
-
CREATE UNIQUE INDEX route_module_unique_scope ON metaschema_modules_public.route_module ( database_id, scope, prefix );
|
|
62
|
-
|
|
63
|
-
COMMIT;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
-- Deploy schemas/metaschema_modules_public/tables/server_definition_module/table to pg
|
|
2
|
-
|
|
3
|
-
-- requires: schemas/metaschema_modules_public/schema
|
|
4
|
-
|
|
5
|
-
BEGIN;
|
|
6
|
-
|
|
7
|
-
CREATE TABLE metaschema_modules_public.server_definition_module (
|
|
8
|
-
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
9
|
-
database_id uuid NOT NULL,
|
|
10
|
-
|
|
11
|
-
-- Schema references (if uuid_nil, resolved from schema name or default)
|
|
12
|
-
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
13
|
-
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
14
|
-
|
|
15
|
-
-- Optional schema name overrides (used when schema IDs are not provided)
|
|
16
|
-
public_schema_name text,
|
|
17
|
-
private_schema_name text,
|
|
18
|
-
|
|
19
|
-
-- Generated table IDs (populated by the generator)
|
|
20
|
-
definitions_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
21
|
-
|
|
22
|
-
-- Table names (input to the generator — bare names without scope prefix).
|
|
23
|
-
-- The trigger prepends the scope prefix automatically.
|
|
24
|
-
definitions_table_name text NOT NULL DEFAULT 'server_definitions',
|
|
25
|
-
|
|
26
|
-
-- API routing (get-or-create: if set, schema is added to this API; if NULL, no API is added)
|
|
27
|
-
api_name text,
|
|
28
|
-
private_api_name text,
|
|
29
|
-
|
|
30
|
-
-- Scope: determines the security level for this module instance.
|
|
31
|
-
-- Resolved to a membership_type integer at trigger time via membership_types table.
|
|
32
|
-
scope text NOT NULL DEFAULT 'platform',
|
|
33
|
-
|
|
34
|
-
-- Table name prefix. Auto-derived from scope by the trigger when empty.
|
|
35
|
-
-- Override to create multiple module instances at the same scope.
|
|
36
|
-
prefix text NOT NULL DEFAULT '',
|
|
37
|
-
|
|
38
|
-
-- Entity table for RLS (NULL for platform-level definitions, entity table for entity-scoped)
|
|
39
|
-
entity_table_id uuid NULL,
|
|
40
|
-
|
|
41
|
-
-- Configurable security policies (NULL = use defaults based on scope).
|
|
42
|
-
-- When provided, replaces the default policy set in apply_server_definition_security.
|
|
43
|
-
-- Accepts a JSON array of policy objects:
|
|
44
|
-
-- {"$type": "AuthzEntityMembership", "privileges": ["select", "update"], "data": {...}}
|
|
45
|
-
policies jsonb NULL,
|
|
46
|
-
|
|
47
|
-
-- Per-table provisions overrides from blueprint config.
|
|
48
|
-
-- Keys are table keys (definitions).
|
|
49
|
-
-- When a key is present, the module trigger skips default security for that table;
|
|
50
|
-
-- secure_table_provision applies the custom grants/policies instead.
|
|
51
|
-
provisions jsonb NULL,
|
|
52
|
-
|
|
53
|
-
-- Default permissions: permission names auto-granted to new members.
|
|
54
|
-
-- NULL uses the module's built-in defaults; explicit array overrides them.
|
|
55
|
-
default_permissions text[] DEFAULT NULL,
|
|
56
|
-
|
|
57
|
-
-- Constraints
|
|
58
|
-
CONSTRAINT server_definition_module_db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
|
|
59
|
-
CONSTRAINT server_definition_module_schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
60
|
-
CONSTRAINT server_definition_module_private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
61
|
-
CONSTRAINT server_definition_module_definitions_table_fkey FOREIGN KEY (definitions_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
62
|
-
CONSTRAINT server_definition_module_entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
CREATE INDEX server_definition_module_database_id_idx ON metaschema_modules_public.server_definition_module ( database_id );
|
|
66
|
-
|
|
67
|
-
-- Unique constraint: one server definition module per database per scope per prefix.
|
|
68
|
-
CREATE UNIQUE INDEX server_definition_module_unique_scope ON metaschema_modules_public.server_definition_module ( database_id, scope, prefix );
|
|
69
|
-
|
|
70
|
-
COMMIT;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
-- Deploy schemas/metaschema_modules_public/tables/server_deployment_module/table to pg
|
|
2
|
-
|
|
3
|
-
-- requires: schemas/metaschema_modules_public/schema
|
|
4
|
-
-- requires: schemas/metaschema_modules_public/tables/server_definition_module/table
|
|
5
|
-
-- requires: schemas/metaschema_modules_public/tables/namespace_module/table
|
|
6
|
-
|
|
7
|
-
BEGIN;
|
|
8
|
-
|
|
9
|
-
CREATE TABLE metaschema_modules_public.server_deployment_module (
|
|
10
|
-
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
11
|
-
database_id uuid NOT NULL,
|
|
12
|
-
|
|
13
|
-
-- Schema references (if uuid_nil, resolved from schema name or default)
|
|
14
|
-
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
15
|
-
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
16
|
-
|
|
17
|
-
-- Optional schema name overrides (used when schema IDs are not provided)
|
|
18
|
-
public_schema_name text,
|
|
19
|
-
private_schema_name text,
|
|
20
|
-
|
|
21
|
-
-- Generated table IDs (populated by the generator)
|
|
22
|
-
deployments_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
23
|
-
deployment_events_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
24
|
-
|
|
25
|
-
-- Table names (input to the generator — bare names without scope prefix).
|
|
26
|
-
-- The trigger prepends the scope prefix automatically.
|
|
27
|
-
deployments_table_name text NOT NULL DEFAULT 'server_deployments',
|
|
28
|
-
deployment_events_table_name text NOT NULL DEFAULT 'server_deployment_events',
|
|
29
|
-
|
|
30
|
-
-- API routing (get-or-create: if set, schema is added to this API; if NULL, no API is added)
|
|
31
|
-
api_name text,
|
|
32
|
-
private_api_name text,
|
|
33
|
-
|
|
34
|
-
-- Scope: determines the security level for this module instance.
|
|
35
|
-
-- Resolved to a membership_type integer at trigger time via membership_types table.
|
|
36
|
-
scope text NOT NULL DEFAULT 'app',
|
|
37
|
-
|
|
38
|
-
-- Table name prefix. Auto-derived from scope by the trigger when empty.
|
|
39
|
-
-- Override to create multiple module instances at the same scope.
|
|
40
|
-
prefix text NOT NULL DEFAULT '',
|
|
41
|
-
|
|
42
|
-
-- Entity table for RLS (NULL for app-level deployments, entity table for entity-scoped)
|
|
43
|
-
entity_table_id uuid NULL,
|
|
44
|
-
|
|
45
|
-
-- FK to server_definition_module: which server definitions table deployments reference
|
|
46
|
-
server_definition_module_id uuid NULL,
|
|
47
|
-
|
|
48
|
-
-- FK to namespace_module: which namespaces table deployments reference
|
|
49
|
-
namespace_module_id uuid NULL,
|
|
50
|
-
|
|
51
|
-
-- Configurable security policies (NULL = use defaults based on scope).
|
|
52
|
-
-- When provided, replaces the default policy set in apply_server_deployment_security.
|
|
53
|
-
-- Accepts a JSON array of policy objects:
|
|
54
|
-
-- {"$type": "AuthzEntityMembership", "privileges": ["select", "update"], "data": {...}}
|
|
55
|
-
policies jsonb NULL,
|
|
56
|
-
|
|
57
|
-
-- Per-table provisions overrides from blueprint config.
|
|
58
|
-
-- Keys are table keys (deployments, deployment_events).
|
|
59
|
-
-- When a key is present, the module trigger skips default security for that table;
|
|
60
|
-
-- secure_table_provision applies the custom grants/policies instead.
|
|
61
|
-
provisions jsonb NULL,
|
|
62
|
-
|
|
63
|
-
-- Default permissions: permission names auto-granted to new members.
|
|
64
|
-
-- NULL uses the module's built-in defaults; explicit array overrides them.
|
|
65
|
-
default_permissions text[] DEFAULT NULL,
|
|
66
|
-
|
|
67
|
-
-- Constraints
|
|
68
|
-
CONSTRAINT server_deployment_module_db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
|
|
69
|
-
CONSTRAINT server_deployment_module_schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
70
|
-
CONSTRAINT server_deployment_module_private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
71
|
-
CONSTRAINT server_deployment_module_deployments_table_fkey FOREIGN KEY (deployments_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
72
|
-
CONSTRAINT server_deployment_module_events_table_fkey FOREIGN KEY (deployment_events_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
73
|
-
CONSTRAINT server_deployment_module_entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
74
|
-
CONSTRAINT server_deployment_module_server_def_module_fkey FOREIGN KEY (server_definition_module_id) REFERENCES metaschema_modules_public.server_definition_module (id) ON DELETE SET NULL,
|
|
75
|
-
CONSTRAINT server_deployment_module_namespace_module_fkey FOREIGN KEY (namespace_module_id) REFERENCES metaschema_modules_public.namespace_module (id) ON DELETE SET NULL
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
CREATE INDEX server_deployment_module_database_id_idx ON metaschema_modules_public.server_deployment_module ( database_id );
|
|
79
|
-
|
|
80
|
-
-- Unique constraint: one server deployment module per database per scope per prefix.
|
|
81
|
-
CREATE UNIQUE INDEX server_deployment_module_unique_scope ON metaschema_modules_public.server_deployment_module ( database_id, scope, prefix );
|
|
82
|
-
|
|
83
|
-
COMMIT;
|