@pgpm/metaschema-modules 0.28.4 → 0.28.5
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/certificate_module/table.sql +66 -0
- package/deploy/schemas/metaschema_modules_public/tables/route_module/table.sql +63 -0
- package/deploy/schemas/metaschema_modules_public/tables/server_definition_module/table.sql +70 -0
- package/deploy/schemas/metaschema_modules_public/tables/server_deployment_module/table.sql +83 -0
- package/package.json +2 -2
- package/pgpm.plan +4 -0
- package/revert/schemas/metaschema_modules_public/tables/certificate_module/table.sql +7 -0
- package/revert/schemas/metaschema_modules_public/tables/route_module/table.sql +7 -0
- package/revert/schemas/metaschema_modules_public/tables/server_definition_module/table.sql +7 -0
- package/revert/schemas/metaschema_modules_public/tables/server_deployment_module/table.sql +7 -0
- package/sql/metaschema-modules--0.15.5.sql +207 -1
- package/verify/schemas/metaschema_modules_public/tables/certificate_module/table.sql +7 -0
- package/verify/schemas/metaschema_modules_public/tables/route_module/table.sql +7 -0
- package/verify/schemas/metaschema_modules_public/tables/server_definition_module/table.sql +7 -0
- package/verify/schemas/metaschema_modules_public/tables/server_deployment_module/table.sql +7 -0
|
@@ -0,0 +1,66 @@
|
|
|
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;
|
|
@@ -0,0 +1,63 @@
|
|
|
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;
|
|
@@ -0,0 +1,70 @@
|
|
|
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;
|
|
@@ -0,0 +1,83 @@
|
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpm/metaschema-modules",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.5",
|
|
4
4
|
"description": "Module metadata handling and dependency tracking",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"bugs": {
|
|
37
37
|
"url": "https://github.com/constructive-io/pgpm-modules/issues"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "1ea2567e22a81f4d0b2bea83c3e1289406015e58"
|
|
40
40
|
}
|
package/pgpm.plan
CHANGED
|
@@ -70,3 +70,7 @@ schemas/metaschema_modules_public/tables/i18n_module/table [schemas/metaschema_m
|
|
|
70
70
|
schemas/metaschema_modules_public/tables/function_deployment_module/table [schemas/metaschema_modules_public/schema schemas/metaschema_modules_public/tables/function_module/table schemas/metaschema_modules_public/tables/namespace_module/table] 2026-06-11T06:00:00Z devin <devin@cognition.ai> # add function_deployment_module config table for function-to-namespace deployment binding
|
|
71
71
|
schemas/metaschema_modules_public/tables/function_module/constraints/one_platform_database [schemas/metaschema_modules_public/tables/function_module/table] 2026-06-11T08:00:00Z devin <devin@cognition.ai> # enforce at most one platform-scope function_module (unambiguous resolveDatabaseId)
|
|
72
72
|
schemas/metaschema_modules_public/tables/principal_auth_module/table [schemas/metaschema_modules_public/schema] 2026-06-24T11:15:00Z devin <devin@cognition.ai> # add principal_auth_module config table for scoped API keys and agent principals
|
|
73
|
+
schemas/metaschema_modules_public/tables/server_definition_module/table [schemas/metaschema_modules_public/schema] 2026-06-30T00:00:00Z devin <devin@cognition.ai> # add server_definition_module config table for persistent server definitions (GraphQL, agentic, WebSocket, etc.)
|
|
74
|
+
schemas/metaschema_modules_public/tables/server_deployment_module/table [schemas/metaschema_modules_public/schema schemas/metaschema_modules_public/tables/server_definition_module/table schemas/metaschema_modules_public/tables/namespace_module/table] 2026-06-30T00:00:01Z devin <devin@cognition.ai> # add server_deployment_module config table for server-to-namespace deployment binding
|
|
75
|
+
schemas/metaschema_modules_public/tables/route_module/table [schemas/metaschema_modules_public/schema] 2026-06-30T00:00:02Z devin <devin@cognition.ai> # add route_module config table for gateway route rules (domain+path to backend target)
|
|
76
|
+
schemas/metaschema_modules_public/tables/certificate_module/table [schemas/metaschema_modules_public/schema] 2026-06-30T00:00:03Z devin <devin@cognition.ai> # add certificate_module config table for TLS certificate lifecycle management
|
|
@@ -3466,4 +3466,210 @@ COMMENT ON CONSTRAINT session_credentials_table_fkey ON metaschema_modules_publi
|
|
|
3466
3466
|
|
|
3467
3467
|
COMMENT ON CONSTRAINT principal_entities_table_fkey ON metaschema_modules_public.principal_auth_module IS '@omit';
|
|
3468
3468
|
|
|
3469
|
-
COMMENT ON TABLE metaschema_modules_public.principal_auth_module IS 'Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.';
|
|
3469
|
+
COMMENT ON TABLE metaschema_modules_public.principal_auth_module IS 'Provisions the principals subsystem: a principals table, a principal_entities junction table, create/delete mutations, and org API key management. Supports both human-owned principals (AuthzDirectOwner, AuthzHumanOnly) and org-owned principals (AuthzEntityMembership with is_admin). Org principal and org API key functions are only generated when an org-scoped memberships_module exists for the database.';
|
|
3470
|
+
|
|
3471
|
+
CREATE TABLE metaschema_modules_public.server_definition_module (
|
|
3472
|
+
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
3473
|
+
database_id uuid NOT NULL,
|
|
3474
|
+
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3475
|
+
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3476
|
+
public_schema_name text,
|
|
3477
|
+
private_schema_name text,
|
|
3478
|
+
definitions_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3479
|
+
definitions_table_name text NOT NULL DEFAULT 'server_definitions',
|
|
3480
|
+
api_name text,
|
|
3481
|
+
private_api_name text,
|
|
3482
|
+
scope text NOT NULL DEFAULT 'platform',
|
|
3483
|
+
prefix text NOT NULL DEFAULT '',
|
|
3484
|
+
entity_table_id uuid NULL,
|
|
3485
|
+
policies jsonb NULL,
|
|
3486
|
+
provisions jsonb NULL,
|
|
3487
|
+
default_permissions text[] DEFAULT NULL,
|
|
3488
|
+
CONSTRAINT server_definition_module_db_fkey
|
|
3489
|
+
FOREIGN KEY(database_id)
|
|
3490
|
+
REFERENCES metaschema_public.database (id)
|
|
3491
|
+
ON DELETE CASCADE,
|
|
3492
|
+
CONSTRAINT server_definition_module_schema_fkey
|
|
3493
|
+
FOREIGN KEY(schema_id)
|
|
3494
|
+
REFERENCES metaschema_public.schema (id)
|
|
3495
|
+
ON DELETE CASCADE,
|
|
3496
|
+
CONSTRAINT server_definition_module_private_schema_fkey
|
|
3497
|
+
FOREIGN KEY(private_schema_id)
|
|
3498
|
+
REFERENCES metaschema_public.schema (id)
|
|
3499
|
+
ON DELETE CASCADE,
|
|
3500
|
+
CONSTRAINT server_definition_module_definitions_table_fkey
|
|
3501
|
+
FOREIGN KEY(definitions_table_id)
|
|
3502
|
+
REFERENCES metaschema_public."table" (id)
|
|
3503
|
+
ON DELETE CASCADE,
|
|
3504
|
+
CONSTRAINT server_definition_module_entity_table_fkey
|
|
3505
|
+
FOREIGN KEY(entity_table_id)
|
|
3506
|
+
REFERENCES metaschema_public."table" (id)
|
|
3507
|
+
ON DELETE CASCADE
|
|
3508
|
+
);
|
|
3509
|
+
|
|
3510
|
+
CREATE INDEX server_definition_module_database_id_idx ON metaschema_modules_public.server_definition_module (database_id);
|
|
3511
|
+
|
|
3512
|
+
CREATE UNIQUE INDEX server_definition_module_unique_scope ON metaschema_modules_public.server_definition_module (database_id, scope, prefix);
|
|
3513
|
+
|
|
3514
|
+
CREATE TABLE metaschema_modules_public.server_deployment_module (
|
|
3515
|
+
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
3516
|
+
database_id uuid NOT NULL,
|
|
3517
|
+
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3518
|
+
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3519
|
+
public_schema_name text,
|
|
3520
|
+
private_schema_name text,
|
|
3521
|
+
deployments_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3522
|
+
deployment_events_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3523
|
+
deployments_table_name text NOT NULL DEFAULT 'server_deployments',
|
|
3524
|
+
deployment_events_table_name text NOT NULL DEFAULT 'server_deployment_events',
|
|
3525
|
+
api_name text,
|
|
3526
|
+
private_api_name text,
|
|
3527
|
+
scope text NOT NULL DEFAULT 'app',
|
|
3528
|
+
prefix text NOT NULL DEFAULT '',
|
|
3529
|
+
entity_table_id uuid NULL,
|
|
3530
|
+
server_definition_module_id uuid NULL,
|
|
3531
|
+
namespace_module_id uuid NULL,
|
|
3532
|
+
policies jsonb NULL,
|
|
3533
|
+
provisions jsonb NULL,
|
|
3534
|
+
default_permissions text[] DEFAULT NULL,
|
|
3535
|
+
CONSTRAINT server_deployment_module_db_fkey
|
|
3536
|
+
FOREIGN KEY(database_id)
|
|
3537
|
+
REFERENCES metaschema_public.database (id)
|
|
3538
|
+
ON DELETE CASCADE,
|
|
3539
|
+
CONSTRAINT server_deployment_module_schema_fkey
|
|
3540
|
+
FOREIGN KEY(schema_id)
|
|
3541
|
+
REFERENCES metaschema_public.schema (id)
|
|
3542
|
+
ON DELETE CASCADE,
|
|
3543
|
+
CONSTRAINT server_deployment_module_private_schema_fkey
|
|
3544
|
+
FOREIGN KEY(private_schema_id)
|
|
3545
|
+
REFERENCES metaschema_public.schema (id)
|
|
3546
|
+
ON DELETE CASCADE,
|
|
3547
|
+
CONSTRAINT server_deployment_module_deployments_table_fkey
|
|
3548
|
+
FOREIGN KEY(deployments_table_id)
|
|
3549
|
+
REFERENCES metaschema_public."table" (id)
|
|
3550
|
+
ON DELETE CASCADE,
|
|
3551
|
+
CONSTRAINT server_deployment_module_events_table_fkey
|
|
3552
|
+
FOREIGN KEY(deployment_events_table_id)
|
|
3553
|
+
REFERENCES metaschema_public."table" (id)
|
|
3554
|
+
ON DELETE CASCADE,
|
|
3555
|
+
CONSTRAINT server_deployment_module_entity_table_fkey
|
|
3556
|
+
FOREIGN KEY(entity_table_id)
|
|
3557
|
+
REFERENCES metaschema_public."table" (id)
|
|
3558
|
+
ON DELETE CASCADE,
|
|
3559
|
+
CONSTRAINT server_deployment_module_server_def_module_fkey
|
|
3560
|
+
FOREIGN KEY(server_definition_module_id)
|
|
3561
|
+
REFERENCES metaschema_modules_public.server_definition_module (id)
|
|
3562
|
+
ON DELETE SET NULL,
|
|
3563
|
+
CONSTRAINT server_deployment_module_namespace_module_fkey
|
|
3564
|
+
FOREIGN KEY(namespace_module_id)
|
|
3565
|
+
REFERENCES metaschema_modules_public.namespace_module (id)
|
|
3566
|
+
ON DELETE SET NULL
|
|
3567
|
+
);
|
|
3568
|
+
|
|
3569
|
+
CREATE INDEX server_deployment_module_database_id_idx ON metaschema_modules_public.server_deployment_module (database_id);
|
|
3570
|
+
|
|
3571
|
+
CREATE UNIQUE INDEX server_deployment_module_unique_scope ON metaschema_modules_public.server_deployment_module (database_id, scope, prefix);
|
|
3572
|
+
|
|
3573
|
+
CREATE TABLE metaschema_modules_public.route_module (
|
|
3574
|
+
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
3575
|
+
database_id uuid NOT NULL,
|
|
3576
|
+
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3577
|
+
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3578
|
+
public_schema_name text,
|
|
3579
|
+
private_schema_name text,
|
|
3580
|
+
routes_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3581
|
+
route_events_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3582
|
+
routes_table_name text NOT NULL DEFAULT 'routes',
|
|
3583
|
+
route_events_table_name text NOT NULL DEFAULT 'route_events',
|
|
3584
|
+
api_name text,
|
|
3585
|
+
private_api_name text,
|
|
3586
|
+
scope text NOT NULL DEFAULT 'platform',
|
|
3587
|
+
prefix text NOT NULL DEFAULT '',
|
|
3588
|
+
entity_table_id uuid NULL,
|
|
3589
|
+
policies jsonb NULL,
|
|
3590
|
+
provisions jsonb NULL,
|
|
3591
|
+
default_permissions text[] DEFAULT NULL,
|
|
3592
|
+
CONSTRAINT route_module_db_fkey
|
|
3593
|
+
FOREIGN KEY(database_id)
|
|
3594
|
+
REFERENCES metaschema_public.database (id)
|
|
3595
|
+
ON DELETE CASCADE,
|
|
3596
|
+
CONSTRAINT route_module_schema_fkey
|
|
3597
|
+
FOREIGN KEY(schema_id)
|
|
3598
|
+
REFERENCES metaschema_public.schema (id)
|
|
3599
|
+
ON DELETE CASCADE,
|
|
3600
|
+
CONSTRAINT route_module_private_schema_fkey
|
|
3601
|
+
FOREIGN KEY(private_schema_id)
|
|
3602
|
+
REFERENCES metaschema_public.schema (id)
|
|
3603
|
+
ON DELETE CASCADE,
|
|
3604
|
+
CONSTRAINT route_module_routes_table_fkey
|
|
3605
|
+
FOREIGN KEY(routes_table_id)
|
|
3606
|
+
REFERENCES metaschema_public."table" (id)
|
|
3607
|
+
ON DELETE CASCADE,
|
|
3608
|
+
CONSTRAINT route_module_events_table_fkey
|
|
3609
|
+
FOREIGN KEY(route_events_table_id)
|
|
3610
|
+
REFERENCES metaschema_public."table" (id)
|
|
3611
|
+
ON DELETE CASCADE,
|
|
3612
|
+
CONSTRAINT route_module_entity_table_fkey
|
|
3613
|
+
FOREIGN KEY(entity_table_id)
|
|
3614
|
+
REFERENCES metaschema_public."table" (id)
|
|
3615
|
+
ON DELETE CASCADE
|
|
3616
|
+
);
|
|
3617
|
+
|
|
3618
|
+
CREATE INDEX route_module_database_id_idx ON metaschema_modules_public.route_module (database_id);
|
|
3619
|
+
|
|
3620
|
+
CREATE UNIQUE INDEX route_module_unique_scope ON metaschema_modules_public.route_module (database_id, scope, prefix);
|
|
3621
|
+
|
|
3622
|
+
CREATE TABLE metaschema_modules_public.certificate_module (
|
|
3623
|
+
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
3624
|
+
database_id uuid NOT NULL,
|
|
3625
|
+
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3626
|
+
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3627
|
+
public_schema_name text,
|
|
3628
|
+
private_schema_name text,
|
|
3629
|
+
certificates_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3630
|
+
certificate_domains_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3631
|
+
certificate_events_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
3632
|
+
certificates_table_name text NOT NULL DEFAULT 'certificates',
|
|
3633
|
+
certificate_domains_table_name text NOT NULL DEFAULT 'certificate_domains',
|
|
3634
|
+
certificate_events_table_name text NOT NULL DEFAULT 'certificate_events',
|
|
3635
|
+
api_name text,
|
|
3636
|
+
private_api_name text,
|
|
3637
|
+
scope text NOT NULL DEFAULT 'platform',
|
|
3638
|
+
prefix text NOT NULL DEFAULT '',
|
|
3639
|
+
entity_table_id uuid NULL,
|
|
3640
|
+
policies jsonb NULL,
|
|
3641
|
+
provisions jsonb NULL,
|
|
3642
|
+
default_permissions text[] DEFAULT NULL,
|
|
3643
|
+
CONSTRAINT certificate_module_db_fkey
|
|
3644
|
+
FOREIGN KEY(database_id)
|
|
3645
|
+
REFERENCES metaschema_public.database (id)
|
|
3646
|
+
ON DELETE CASCADE,
|
|
3647
|
+
CONSTRAINT certificate_module_schema_fkey
|
|
3648
|
+
FOREIGN KEY(schema_id)
|
|
3649
|
+
REFERENCES metaschema_public.schema (id)
|
|
3650
|
+
ON DELETE CASCADE,
|
|
3651
|
+
CONSTRAINT certificate_module_private_schema_fkey
|
|
3652
|
+
FOREIGN KEY(private_schema_id)
|
|
3653
|
+
REFERENCES metaschema_public.schema (id)
|
|
3654
|
+
ON DELETE CASCADE,
|
|
3655
|
+
CONSTRAINT certificate_module_certs_table_fkey
|
|
3656
|
+
FOREIGN KEY(certificates_table_id)
|
|
3657
|
+
REFERENCES metaschema_public."table" (id)
|
|
3658
|
+
ON DELETE CASCADE,
|
|
3659
|
+
CONSTRAINT certificate_module_cert_domains_table_fkey
|
|
3660
|
+
FOREIGN KEY(certificate_domains_table_id)
|
|
3661
|
+
REFERENCES metaschema_public."table" (id)
|
|
3662
|
+
ON DELETE CASCADE,
|
|
3663
|
+
CONSTRAINT certificate_module_events_table_fkey
|
|
3664
|
+
FOREIGN KEY(certificate_events_table_id)
|
|
3665
|
+
REFERENCES metaschema_public."table" (id)
|
|
3666
|
+
ON DELETE CASCADE,
|
|
3667
|
+
CONSTRAINT certificate_module_entity_table_fkey
|
|
3668
|
+
FOREIGN KEY(entity_table_id)
|
|
3669
|
+
REFERENCES metaschema_public."table" (id)
|
|
3670
|
+
ON DELETE CASCADE
|
|
3671
|
+
);
|
|
3672
|
+
|
|
3673
|
+
CREATE INDEX certificate_module_database_id_idx ON metaschema_modules_public.certificate_module (database_id);
|
|
3674
|
+
|
|
3675
|
+
CREATE UNIQUE INDEX certificate_module_unique_scope ON metaschema_modules_public.certificate_module (database_id, scope, prefix);
|