@pgpm/metaschema-modules 0.18.0 → 0.19.1

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.
Files changed (43) hide show
  1. package/README.md +7 -7
  2. package/deploy/schemas/metaschema_modules_public/tables/blueprint/table.sql +119 -0
  3. package/deploy/schemas/metaschema_modules_public/tables/blueprint_template/table.sql +137 -0
  4. package/deploy/schemas/metaschema_modules_public/tables/connected_accounts_module/table.sql +1 -6
  5. package/deploy/schemas/metaschema_modules_public/tables/crypto_addresses_module/table.sql +1 -6
  6. package/deploy/schemas/metaschema_modules_public/tables/crypto_auth_module/table.sql +1 -7
  7. package/deploy/schemas/metaschema_modules_public/tables/default_ids_module/table.sql +1 -2
  8. package/deploy/schemas/metaschema_modules_public/tables/denormalized_table_field/table.sql +1 -6
  9. package/deploy/schemas/metaschema_modules_public/tables/emails_module/table.sql +1 -6
  10. package/deploy/schemas/metaschema_modules_public/tables/encrypted_secrets_module/table.sql +1 -6
  11. package/deploy/schemas/metaschema_modules_public/tables/field_module/table.sql +1 -5
  12. package/deploy/schemas/metaschema_modules_public/tables/hierarchy_module/table.sql +1 -19
  13. package/deploy/schemas/metaschema_modules_public/tables/invites_module/table.sql +1 -8
  14. package/deploy/schemas/metaschema_modules_public/tables/levels_module/table.sql +1 -8
  15. package/deploy/schemas/metaschema_modules_public/tables/limits_module/table.sql +1 -14
  16. package/deploy/schemas/metaschema_modules_public/tables/membership_types_module/table.sql +1 -6
  17. package/deploy/schemas/metaschema_modules_public/tables/memberships_module/table.sql +1 -40
  18. package/deploy/schemas/metaschema_modules_public/tables/permissions_module/table.sql +1 -13
  19. package/deploy/schemas/metaschema_modules_public/tables/phone_numbers_module/table.sql +1 -6
  20. package/deploy/schemas/metaschema_modules_public/tables/profiles_module/table.sql +1 -28
  21. package/deploy/schemas/metaschema_modules_public/tables/relation_provision/table.sql +45 -7
  22. package/deploy/schemas/metaschema_modules_public/tables/rls_module/table.sql +2 -7
  23. package/deploy/schemas/metaschema_modules_public/tables/secrets_module/table.sql +1 -6
  24. package/deploy/schemas/metaschema_modules_public/tables/secure_table_provision/table.sql +9 -7
  25. package/deploy/schemas/metaschema_modules_public/tables/sessions_module/table.sql +4 -8
  26. package/deploy/schemas/metaschema_modules_public/tables/table_template_module/table.sql +1 -6
  27. package/deploy/schemas/metaschema_modules_public/tables/user_auth_module/table.sql +1 -3
  28. package/deploy/schemas/metaschema_modules_public/tables/users_module/table.sql +1 -10
  29. package/metaschema-modules.control +1 -1
  30. package/package.json +4 -4
  31. package/pgpm.plan +3 -2
  32. package/revert/schemas/metaschema_modules_public/tables/blueprint/table.sql +7 -0
  33. package/revert/schemas/metaschema_modules_public/tables/blueprint_template/table.sql +7 -0
  34. package/verify/schemas/metaschema_modules_public/tables/blueprint/table.sql +26 -0
  35. package/verify/schemas/metaschema_modules_public/tables/blueprint_template/table.sql +29 -0
  36. package/verify/schemas/metaschema_modules_public/tables/relation_provision/table.sql +1 -0
  37. package/verify/schemas/metaschema_modules_public/tables/secure_table_provision/table.sql +1 -0
  38. package/deploy/schemas/metaschema_modules_public/tables/table_module/table.sql +0 -37
  39. package/deploy/schemas/metaschema_modules_public/tables/uuid_module/table.sql +0 -23
  40. package/revert/schemas/metaschema_modules_public/tables/table_module/table.sql +0 -7
  41. package/revert/schemas/metaschema_modules_public/tables/uuid_module/table.sql +0 -7
  42. package/verify/schemas/metaschema_modules_public/tables/table_module/table.sql +0 -18
  43. package/verify/schemas/metaschema_modules_public/tables/uuid_module/table.sql +0 -7
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @pgpm/db-meta-modules
1
+ # @pgpm/metaschema-modules
2
2
 
3
3
  <p align="center" width="100%">
4
4
  <img height="250" src="https://raw.githubusercontent.com/constructive-io/constructive/refs/heads/main/assets/outline-logo.svg" />
@@ -9,14 +9,14 @@
9
9
  <img height="20" src="https://github.com/constructive-io/pgpm-modules/actions/workflows/ci.yml/badge.svg" />
10
10
  </a>
11
11
  <a href="https://github.com/constructive-io/pgpm-modules/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
12
- <a href="https://www.npmjs.com/package/@pgpm/db-meta-modules"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Fdb-meta-modules%2Fpackage.json"/></a>
12
+ <a href="https://www.npmjs.com/package/@pgpm/metaschema-modules"><img height="20" src="https://img.shields.io/github/package-json/v/constructive-io/pgpm-modules?filename=packages%2Fmetaschema-modules%2Fpackage.json"/></a>
13
13
  </p>
14
14
 
15
15
  Module metadata handling and dependency tracking.
16
16
 
17
17
  ## Overview
18
18
 
19
- `@pgpm/db-meta-modules` extends the `@pgpm/db-meta-schema` package with module-specific metadata tables. This package provides tables for tracking various pgpm modules including authentication, permissions, memberships, encrypted secrets, and more. It enables configuration and metadata storage for modular application features.
19
+ `@pgpm/metaschema-modules` extends the `@pgpm/metaschema-schema` package with module-specific metadata tables. This package provides tables for tracking various pgpm modules including authentication, permissions, memberships, encrypted secrets, and more. It enables configuration and metadata storage for modular application features.
20
20
 
21
21
  ## Features
22
22
 
@@ -33,7 +33,7 @@ Module metadata handling and dependency tracking.
33
33
  If you have `pgpm` installed:
34
34
 
35
35
  ```bash
36
- pgpm install @pgpm/db-meta-modules
36
+ pgpm install @pgpm/metaschema-modules
37
37
  pgpm deploy
38
38
  ```
39
39
 
@@ -56,7 +56,7 @@ eval "$(pgpm env)"
56
56
 
57
57
  ```bash
58
58
  # 1. Install the package
59
- pgpm install @pgpm/db-meta-modules
59
+ pgpm install @pgpm/metaschema-modules
60
60
 
61
61
  # 2. Deploy locally
62
62
  pgpm deploy
@@ -74,7 +74,7 @@ pgpm init
74
74
 
75
75
  # 3. Install a package
76
76
  cd packages/my-module
77
- pgpm install @pgpm/db-meta-modules
77
+ pgpm install @pgpm/metaschema-modules
78
78
 
79
79
  # 4. Deploy everything
80
80
  pgpm deploy --createdb --database mydb1
@@ -213,7 +213,7 @@ Use module tables as feature flags:
213
213
 
214
214
  ## Dependencies
215
215
 
216
- - `@pgpm/db-meta-schema`: Core metadata management
216
+ - `@pgpm/metaschema-schema`: Core metadata management
217
217
  - `@pgpm/verify`: Verification utilities
218
218
 
219
219
  ## Testing
@@ -0,0 +1,119 @@
1
+ -- Deploy schemas/metaschema_modules_public/tables/blueprint/table to pg
2
+
3
+ -- requires: schemas/metaschema_modules_public/schema
4
+ -- requires: schemas/metaschema_modules_public/tables/blueprint_template/table
5
+
6
+ BEGIN;
7
+
8
+ CREATE TABLE metaschema_modules_public.blueprint (
9
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
10
+
11
+ -- Ownership + scoping
12
+ owner_id uuid NOT NULL,
13
+
14
+ database_id uuid NOT NULL,
15
+
16
+ -- Identity
17
+ name text NOT NULL,
18
+
19
+ display_name text NOT NULL,
20
+
21
+ description text,
22
+
23
+ -- The blueprint definition (tables with nodes[] and policies[], relations with $type)
24
+ -- This is a mutable copy — the owner can customize before executing
25
+ definition jsonb NOT NULL,
26
+
27
+ -- Lineage: where did this come from?
28
+ template_id uuid DEFAULT NULL,
29
+
30
+ -- Execution state
31
+ status text NOT NULL DEFAULT 'draft'
32
+ CHECK (status IN ('draft', 'constructed', 'failed')),
33
+
34
+ constructed_at timestamptz,
35
+
36
+ error_details text,
37
+
38
+ -- Output: mapping of ref names to created table IDs (populated after construct)
39
+ ref_map jsonb NOT NULL DEFAULT '{}',
40
+
41
+ -- Snapshot of the definition at construct-time (immutable record of what was actually executed)
42
+ constructed_definition jsonb,
43
+
44
+ -- Content-addressable Merkle hashes (backend-computed via trigger)
45
+ definition_hash uuid,
46
+
47
+ table_hashes jsonb,
48
+
49
+ created_at timestamptz NOT NULL DEFAULT now(),
50
+
51
+ updated_at timestamptz NOT NULL DEFAULT now(),
52
+
53
+ CONSTRAINT blueprint_unique_database_name UNIQUE (database_id, name),
54
+ CONSTRAINT blueprint_db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
55
+ CONSTRAINT blueprint_template_fkey FOREIGN KEY (template_id) REFERENCES metaschema_modules_public.blueprint_template (id)
56
+ );
57
+
58
+ COMMENT ON TABLE metaschema_modules_public.blueprint IS
59
+ 'An owned, executable blueprint scoped to a specific database. Created by copying from a blueprint_template via copy_template_to_blueprint() or built from scratch. The owner can customize the definition before executing it with construct_blueprint(). Each blueprint tracks its execution status (draft/constructed/failed) and stores the ref_map of created table IDs after construction.';
60
+
61
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.id IS
62
+ 'Unique identifier for this blueprint.';
63
+
64
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.owner_id IS
65
+ 'The user who owns this blueprint.';
66
+
67
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.database_id IS
68
+ 'The database this blueprint is scoped to. Tables created by construct_blueprint() are provisioned in this database.';
69
+
70
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.name IS
71
+ 'Machine-readable name for the blueprint. Must be unique per database.';
72
+
73
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.display_name IS
74
+ 'Human-readable display name for the blueprint.';
75
+
76
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.description IS
77
+ 'Optional description of the blueprint.';
78
+
79
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.definition IS
80
+ 'The blueprint definition as a JSONB document. Same format as blueprint_template.definition: contains tables[] (with nodes[], fields[], grants[], policies[] using $type) and relations[] (using $type). This is a mutable copy that the owner can customize before executing.';
81
+
82
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.template_id IS
83
+ 'If this blueprint was created by copying a template, the ID of the source template. NULL if built from scratch.';
84
+
85
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.status IS
86
+ 'Execution state of the blueprint. draft: not yet executed (definition can still be modified). constructed: successfully executed via construct_blueprint(). failed: execution failed (see error_details). Defaults to draft.';
87
+
88
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.constructed_at IS
89
+ 'Timestamp when construct_blueprint() successfully completed. NULL until constructed.';
90
+
91
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.error_details IS
92
+ 'Error message from the most recent failed construct_blueprint() attempt. NULL unless status is failed.';
93
+
94
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.ref_map IS
95
+ 'Mapping of ref names to created table UUIDs, populated by construct_blueprint() after successful execution. Format: {"products": "uuid", "categories": "uuid", ...}. Defaults to empty object.';
96
+
97
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.constructed_definition IS
98
+ 'Immutable snapshot of the definition at construct-time. Preserved so the exact definition that was executed is recorded even if the user later modifies the definition for re-execution. NULL until constructed.';
99
+
100
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.created_at IS
101
+ 'Timestamp when this blueprint was created.';
102
+
103
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.definition_hash IS
104
+ 'UUIDv5 Merkle root hash of the definition. Computed automatically via trigger from the ordered table_hashes. Used for content-addressable deduplication and provenance tracking. Backend-computed — clients should never set this directly.';
105
+
106
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.table_hashes IS
107
+ 'JSONB map of table ref names to their individual UUIDv5 content hashes. Each table hash is computed from the canonical jsonb::text of the table entry. Enables structural comparison at the table level across blueprints and templates. Backend-computed via trigger.';
108
+
109
+ COMMENT ON COLUMN metaschema_modules_public.blueprint.updated_at IS
110
+ 'Timestamp when this blueprint was last modified.';
111
+
112
+
113
+ CREATE INDEX blueprint_owner_id_idx ON metaschema_modules_public.blueprint (owner_id);
114
+ CREATE INDEX blueprint_database_id_idx ON metaschema_modules_public.blueprint (database_id);
115
+ CREATE INDEX blueprint_template_id_idx ON metaschema_modules_public.blueprint (template_id);
116
+ CREATE INDEX blueprint_status_idx ON metaschema_modules_public.blueprint (status);
117
+ CREATE INDEX blueprint_definition_hash_idx ON metaschema_modules_public.blueprint (definition_hash);
118
+
119
+ COMMIT;
@@ -0,0 +1,137 @@
1
+ -- Deploy schemas/metaschema_modules_public/tables/blueprint_template/table to pg
2
+
3
+ -- requires: schemas/metaschema_modules_public/schema
4
+
5
+ BEGIN;
6
+
7
+ CREATE TABLE metaschema_modules_public.blueprint_template (
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
+
10
+ -- Identity
11
+ name text NOT NULL,
12
+
13
+ version text NOT NULL DEFAULT '1.0.0',
14
+
15
+ display_name text NOT NULL,
16
+
17
+ description text,
18
+
19
+ -- Ownership
20
+ owner_id uuid NOT NULL,
21
+
22
+ -- Visibility
23
+ visibility text NOT NULL DEFAULT 'private'
24
+ CHECK (visibility IN ('private', 'public')),
25
+
26
+ -- Categorization
27
+ categories text[] NOT NULL DEFAULT '{}',
28
+
29
+ tags text[] NOT NULL DEFAULT '{}',
30
+
31
+ -- The blueprint definition (tables with nodes[] and policies[], relations with $type)
32
+ definition jsonb NOT NULL,
33
+
34
+ -- Schema for validating definition structure
35
+ definition_schema_version text NOT NULL DEFAULT '1',
36
+
37
+ -- Provenance
38
+ source text NOT NULL DEFAULT 'user'
39
+ CHECK (source IN ('user', 'system', 'agent')),
40
+
41
+ -- Complexity indicator
42
+ complexity text DEFAULT NULL
43
+ CHECK (complexity IS NULL OR complexity IN ('simple', 'moderate', 'complex')),
44
+
45
+ -- Marketplace stats (denormalized for query perf)
46
+ copy_count integer NOT NULL DEFAULT 0,
47
+
48
+ fork_count integer NOT NULL DEFAULT 0,
49
+
50
+ -- If this template was forked from another
51
+ forked_from_id uuid DEFAULT NULL,
52
+
53
+ -- Content-addressable Merkle hashes (backend-computed via trigger)
54
+ definition_hash uuid,
55
+
56
+ table_hashes jsonb,
57
+
58
+ created_at timestamptz NOT NULL DEFAULT now(),
59
+
60
+ updated_at timestamptz NOT NULL DEFAULT now(),
61
+
62
+ CONSTRAINT blueprint_template_unique_owner_name_version UNIQUE (owner_id, name, version),
63
+ CONSTRAINT blueprint_template_forked_from_fkey FOREIGN KEY (forked_from_id) REFERENCES metaschema_modules_public.blueprint_template(id)
64
+ );
65
+
66
+ COMMENT ON TABLE metaschema_modules_public.blueprint_template IS
67
+ 'A shareable, versioned schema recipe for the blueprint marketplace. Templates define arrays of secure_table_provision + relation_provision inputs that together describe a complete domain schema (e.g. e-commerce, telemedicine, habit tracker). Templates are never executed directly — they are copied into a blueprint first via copy_template_to_blueprint(). Can be private (owner-only) or public (marketplace-visible).';
68
+
69
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.id IS
70
+ 'Unique identifier for this template.';
71
+
72
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.name IS
73
+ 'Machine-readable name for the template (e.g. e_commerce_basic). Must be unique per owner + version.';
74
+
75
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.version IS
76
+ 'Semantic version string. Defaults to 1.0.0.';
77
+
78
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.display_name IS
79
+ 'Human-readable display name for the template (e.g. E-Commerce Basic).';
80
+
81
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.description IS
82
+ 'Optional description of what the template provisions.';
83
+
84
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.owner_id IS
85
+ 'The user who created or published this template.';
86
+
87
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.visibility IS
88
+ 'Access control for the template. private: only the owner can see and copy. public: anyone can browse and copy from the marketplace. Defaults to private.';
89
+
90
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.categories IS
91
+ 'Domain categories for marketplace browsing (e.g. e-commerce, healthcare, social). Defaults to empty array.';
92
+
93
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.tags IS
94
+ 'Freeform tags for search and discovery (e.g. products, orders, payments). Defaults to empty array.';
95
+
96
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.definition IS
97
+ 'The blueprint definition as a JSONB document. Contains tables[] (each with nodes[] for data behaviors via string shorthand or {"$type": "...", "data": {...}} objects, fields[], grants[], and policies[] using {"$type": "...", "data": {...}}), and relations[] (using $type for relation_type with junction config in data). This is the core payload that gets copied into a blueprint for execution.';
98
+
99
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.definition_schema_version IS
100
+ 'Version of the definition format schema. Used for forward-compatible parsing. Defaults to 1.';
101
+
102
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.source IS
103
+ 'Provenance of the template. user: manually created by a human. system: official curated template from the Constructive team. agent: AI-generated. Defaults to user.';
104
+
105
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.complexity IS
106
+ 'Complexity indicator for marketplace filtering. simple: 3-5 tables. moderate: 6-12 tables. complex: 13+ tables. NULL if not categorized.';
107
+
108
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.copy_count IS
109
+ 'Denormalized count of how many blueprints have been created from this template via copy_template_to_blueprint(). Incremented automatically. Defaults to 0.';
110
+
111
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.fork_count IS
112
+ 'Denormalized count of how many derivative templates have been forked from this template. Defaults to 0.';
113
+
114
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.forked_from_id IS
115
+ 'If this template was forked from another template, the ID of the parent. NULL for original templates.';
116
+
117
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.created_at IS
118
+ 'Timestamp when this template was created.';
119
+
120
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.definition_hash IS
121
+ 'UUIDv5 Merkle root hash of the definition. Computed automatically via trigger from the ordered table_hashes. Used for content-addressable deduplication, provenance tracking, and cross-blueprint structural comparison. NULL columns are backend-computed — clients should never set this directly.';
122
+
123
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.table_hashes IS
124
+ 'JSONB map of table ref names to their individual UUIDv5 content hashes (e.g. {"products": "uuid", "categories": "uuid"}). Each table hash is computed from the canonical jsonb::text of the table entry. Enables structural comparison at the table level across different blueprints. Backend-computed via trigger.';
125
+
126
+ COMMENT ON COLUMN metaschema_modules_public.blueprint_template.updated_at IS
127
+ 'Timestamp when this template was last modified.';
128
+
129
+
130
+ CREATE INDEX blueprint_template_owner_id_idx ON metaschema_modules_public.blueprint_template (owner_id);
131
+ CREATE INDEX blueprint_template_visibility_idx ON metaschema_modules_public.blueprint_template (visibility);
132
+ CREATE INDEX blueprint_template_forked_from_id_idx ON metaschema_modules_public.blueprint_template (forked_from_id);
133
+ CREATE INDEX blueprint_template_categories_idx ON metaschema_modules_public.blueprint_template USING gin (categories);
134
+ CREATE INDEX blueprint_template_tags_idx ON metaschema_modules_public.blueprint_template USING gin (tags);
135
+ CREATE INDEX blueprint_template_definition_hash_idx ON metaschema_modules_public.blueprint_template (definition_hash);
136
+
137
+ COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.connected_accounts_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  schema_id uuid NOT NULL DEFAULT uuid_nil(),
@@ -24,11 +24,6 @@ CREATE TABLE metaschema_modules_public.connected_accounts_module (
24
24
  CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE
25
25
  );
26
26
 
27
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.connected_accounts_module IS E'@omit manyToMany';
28
- COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.connected_accounts_module IS E'@omit manyToMany';
29
- COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.connected_accounts_module IS E'@omit manyToMany';
30
- COMMENT ON CONSTRAINT owner_table_fkey ON metaschema_modules_public.connected_accounts_module IS E'@omit manyToMany';
31
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.connected_accounts_module IS E'@omit manyToMany';
32
27
  CREATE INDEX connected_accounts_module_database_id_idx ON metaschema_modules_public.connected_accounts_module ( database_id );
33
28
 
34
29
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.crypto_addresses_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  schema_id uuid NOT NULL DEFAULT uuid_nil(),
@@ -25,11 +25,6 @@ CREATE TABLE metaschema_modules_public.crypto_addresses_module (
25
25
  CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE
26
26
  );
27
27
 
28
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.crypto_addresses_module IS E'@omit manyToMany';
29
- COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.crypto_addresses_module IS E'@omit manyToMany';
30
- COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.crypto_addresses_module IS E'@omit manyToMany';
31
- COMMENT ON CONSTRAINT owner_table_fkey ON metaschema_modules_public.crypto_addresses_module IS E'@omit manyToMany';
32
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.crypto_addresses_module IS E'@omit manyToMany';
33
28
  CREATE INDEX crypto_addresses_module_database_id_idx ON metaschema_modules_public.crypto_addresses_module ( database_id );
34
29
 
35
30
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.crypto_auth_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  schema_id uuid NOT NULL DEFAULT uuid_nil(),
@@ -35,13 +35,7 @@ CREATE TABLE metaschema_modules_public.crypto_auth_module (
35
35
  CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE
36
36
  );
37
37
 
38
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.crypto_auth_module IS E'@omit manyToMany';
39
- COMMENT ON CONSTRAINT secrets_table_fkey ON metaschema_modules_public.crypto_auth_module IS E'@omit manyToMany';
40
- COMMENT ON CONSTRAINT users_table_fkey ON metaschema_modules_public.crypto_auth_module IS E'@omit manyToMany';
41
38
  -- TOKENS_REMOVAL: tokens_table_fkey comment removed
42
- COMMENT ON CONSTRAINT sessions_table_fkey ON metaschema_modules_public.crypto_auth_module IS E'@omit manyToMany';
43
- COMMENT ON CONSTRAINT session_credentials_table_fkey ON metaschema_modules_public.crypto_auth_module IS E'@omit manyToMany';
44
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.crypto_auth_module IS E'@omit manyToMany';
45
39
  CREATE INDEX crypto_auth_module_database_id_idx ON metaschema_modules_public.crypto_auth_module ( database_id );
46
40
 
47
41
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.default_ids_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  --
@@ -13,7 +13,6 @@ CREATE TABLE metaschema_modules_public.default_ids_module (
13
13
  CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE
14
14
  );
15
15
 
16
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.default_ids_module IS E'@omit manyToMany';
17
16
  CREATE INDEX default_ids_module_database_id_idx ON metaschema_modules_public.default_ids_module ( database_id );
18
17
 
19
18
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.denormalized_table_field (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  table_id uuid NOT NULL,
@@ -31,11 +31,6 @@ CREATE TABLE metaschema_modules_public.denormalized_table_field (
31
31
  CONSTRAINT ref_field_fkey FOREIGN KEY (ref_field_id) REFERENCES metaschema_public.field (id) ON DELETE CASCADE
32
32
  );
33
33
 
34
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.denormalized_table_field IS E'@omit manyToMany';
35
- COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.denormalized_table_field IS E'@omit manyToMany';
36
- COMMENT ON CONSTRAINT ref_table_fkey ON metaschema_modules_public.denormalized_table_field IS E'@omit manyToMany';
37
- COMMENT ON CONSTRAINT field_fkey ON metaschema_modules_public.denormalized_table_field IS E'@omit manyToMany';
38
- COMMENT ON CONSTRAINT ref_field_fkey ON metaschema_modules_public.denormalized_table_field IS E'@omit manyToMany';
39
34
  CREATE INDEX denormalized_table_field_database_id_idx ON metaschema_modules_public.denormalized_table_field ( database_id );
40
35
 
41
36
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.emails_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  schema_id uuid NOT NULL DEFAULT uuid_nil(),
@@ -24,11 +24,6 @@ CREATE TABLE metaschema_modules_public.emails_module (
24
24
  CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE
25
25
  );
26
26
 
27
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.emails_module IS E'@omit manyToMany';
28
- COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.emails_module IS E'@omit manyToMany';
29
- COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.emails_module IS E'@omit manyToMany';
30
- COMMENT ON CONSTRAINT owner_table_fkey ON metaschema_modules_public.emails_module IS E'@omit manyToMany';
31
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.emails_module IS E'@omit manyToMany';
32
27
  CREATE INDEX emails_module_database_id_idx ON metaschema_modules_public.emails_module ( database_id );
33
28
 
34
29
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.encrypted_secrets_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  --
@@ -19,11 +19,6 @@ CREATE TABLE metaschema_modules_public.encrypted_secrets_module (
19
19
  CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
20
20
  );
21
21
 
22
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.encrypted_secrets_module IS E'@omit manyToMany';
23
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.encrypted_secrets_module IS E'@omit manyToMany';
24
22
  CREATE INDEX encrypted_secrets_module_database_id_idx ON metaschema_modules_public.encrypted_secrets_module ( database_id );
25
23
 
26
- COMMENT ON CONSTRAINT table_fkey
27
- ON metaschema_modules_public.encrypted_secrets_module IS E'@omit manyToMany';
28
-
29
24
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.field_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
@@ -33,10 +33,6 @@ CREATE TABLE metaschema_modules_public.field_module (
33
33
  CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE
34
34
  );
35
35
 
36
- COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.field_module IS E'@omit manyToMany';
37
- COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.field_module IS E'@omit manyToMany';
38
- COMMENT ON CONSTRAINT field_fkey ON metaschema_modules_public.field_module IS E'@omit manyToMany';
39
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.field_module IS E'@omit manyToMany';
40
36
  CREATE INDEX field_module_database_id_idx ON metaschema_modules_public.field_module ( database_id );
41
37
  CREATE INDEX field_module_node_type_idx ON metaschema_modules_public.field_module ( node_type );
42
38
 
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.hierarchy_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  -- Schema references
@@ -56,24 +56,6 @@ CREATE TABLE metaschema_modules_public.hierarchy_module (
56
56
  CONSTRAINT hierarchy_module_database_unique UNIQUE (database_id)
57
57
  );
58
58
 
59
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.hierarchy_module IS E'@omit manyToMany';
60
- COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.hierarchy_module IS E'@omit manyToMany';
61
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.hierarchy_module IS E'@omit manyToMany';
62
59
  CREATE INDEX hierarchy_module_database_id_idx ON metaschema_modules_public.hierarchy_module ( database_id );
63
60
 
64
- COMMENT ON CONSTRAINT chart_edges_table_fkey
65
- ON metaschema_modules_public.hierarchy_module IS E'@omit manyToMany';
66
-
67
- COMMENT ON CONSTRAINT hierarchy_sprt_table_fkey
68
- ON metaschema_modules_public.hierarchy_module IS E'@omit manyToMany';
69
-
70
- COMMENT ON CONSTRAINT chart_edge_grants_table_fkey
71
- ON metaschema_modules_public.hierarchy_module IS E'@omit manyToMany';
72
-
73
- COMMENT ON CONSTRAINT entity_table_fkey
74
- ON metaschema_modules_public.hierarchy_module IS E'@omit manyToMany';
75
-
76
- COMMENT ON CONSTRAINT users_table_fkey
77
- ON metaschema_modules_public.hierarchy_module IS E'@omit manyToMany';
78
-
79
61
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.invites_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  schema_id uuid NOT NULL DEFAULT uuid_nil(),
@@ -39,13 +39,6 @@ CREATE TABLE metaschema_modules_public.invites_module (
39
39
  CONSTRAINT pschema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE
40
40
  );
41
41
 
42
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.invites_module IS E'@omit manyToMany';
43
- COMMENT ON CONSTRAINT emails_table_fkey ON metaschema_modules_public.invites_module IS E'@omit manyToMany';
44
- COMMENT ON CONSTRAINT users_table_fkey ON metaschema_modules_public.invites_module IS E'@omit manyToMany';
45
- COMMENT ON CONSTRAINT invites_table_fkey ON metaschema_modules_public.invites_module IS E'@omit manyToMany';
46
- COMMENT ON CONSTRAINT claimed_invites_table_fkey ON metaschema_modules_public.invites_module IS E'@omit manyToMany';
47
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.invites_module IS E'@omit manyToMany';
48
- COMMENT ON CONSTRAINT pschema_fkey ON metaschema_modules_public.invites_module IS E'@omit manyToMany';
49
42
  CREATE INDEX invites_module_database_id_idx ON metaschema_modules_public.invites_module ( database_id );
50
43
 
51
44
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.levels_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
 
11
11
  --
@@ -59,13 +59,6 @@ CREATE TABLE metaschema_modules_public.levels_module (
59
59
  CONSTRAINT actor_table_fkey FOREIGN KEY (actor_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
60
60
  );
61
61
 
62
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.levels_module IS E'@omit manyToMany';
63
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.levels_module IS E'@omit manyToMany';
64
- COMMENT ON CONSTRAINT steps_table_fkey ON metaschema_modules_public.levels_module IS E'@omit manyToMany';
65
- COMMENT ON CONSTRAINT achievements_table_fkey ON metaschema_modules_public.levels_module IS E'@omit manyToMany';
66
- COMMENT ON CONSTRAINT levels_table_fkey ON metaschema_modules_public.levels_module IS E'@omit manyToMany';
67
- COMMENT ON CONSTRAINT level_requirements_table_fkey ON metaschema_modules_public.levels_module IS E'@omit manyToMany';
68
- COMMENT ON CONSTRAINT actor_table_fkey ON metaschema_modules_public.levels_module IS E'@omit manyToMany';
69
62
  CREATE INDEX user_status_module_database_id_idx ON metaschema_modules_public.levels_module ( database_id );
70
63
 
71
64
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.limits_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
  --
11
11
  schema_id uuid NOT NULL DEFAULT uuid_nil(),
@@ -45,19 +45,6 @@ CREATE TABLE metaschema_modules_public.limits_module (
45
45
 
46
46
  );
47
47
 
48
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.limits_module IS E'@omit manyToMany';
49
- COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.limits_module IS E'@omit manyToMany';
50
-
51
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.limits_module IS E'@omit manyToMany';
52
48
  CREATE INDEX limits_module_database_id_idx ON metaschema_modules_public.limits_module ( database_id );
53
49
 
54
- COMMENT ON CONSTRAINT table_fkey
55
- ON metaschema_modules_public.limits_module IS E'@omit manyToMany';
56
-
57
- COMMENT ON CONSTRAINT default_table_fkey
58
- ON metaschema_modules_public.limits_module IS E'@omit manyToMany';
59
-
60
- COMMENT ON CONSTRAINT actor_table_fkey
61
- ON metaschema_modules_public.limits_module IS E'@omit manyToMany';
62
-
63
50
  COMMIT;
@@ -5,7 +5,7 @@
5
5
  BEGIN;
6
6
 
7
7
  CREATE TABLE metaschema_modules_public.membership_types_module (
8
- id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (),
8
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
9
9
  database_id uuid NOT NULL,
10
10
  --
11
11
  schema_id uuid NOT NULL DEFAULT uuid_nil(),
@@ -20,11 +20,6 @@ CREATE TABLE metaschema_modules_public.membership_types_module (
20
20
  CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
21
21
  );
22
22
 
23
- COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.membership_types_module IS E'@omit manyToMany';
24
- COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.membership_types_module IS E'@omit manyToMany';
25
23
  CREATE INDEX membership_types_module_database_id_idx ON metaschema_modules_public.membership_types_module ( database_id );
26
24
 
27
- COMMENT ON CONSTRAINT table_fkey
28
- ON metaschema_modules_public.membership_types_module IS E'@omit manyToMany';
29
-
30
25
  COMMIT;