@pgpm/metaschema-modules 0.22.0 → 0.26.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/README.md +1 -1
- package/deploy/schemas/metaschema_modules_public/tables/billing_module/table.sql +5 -0
- package/deploy/schemas/metaschema_modules_public/tables/config_secrets_org_module/table.sql +28 -0
- package/deploy/schemas/metaschema_modules_public/tables/{encrypted_secrets_module → config_secrets_user_module}/table.sql +4 -4
- package/deploy/schemas/metaschema_modules_public/tables/entity_type_provision/table.sql +44 -33
- package/deploy/schemas/metaschema_modules_public/tables/events_module/table.sql +85 -0
- package/deploy/schemas/metaschema_modules_public/tables/inference_log_module/table.sql +39 -0
- package/deploy/schemas/metaschema_modules_public/tables/limits_module/table.sql +11 -1
- package/deploy/schemas/metaschema_modules_public/tables/rate_limit_meters_module/table.sql +51 -0
- package/deploy/schemas/metaschema_modules_public/tables/realtime_module/table.sql +2 -2
- package/deploy/schemas/metaschema_modules_public/tables/storage_module/table.sql +12 -3
- package/deploy/schemas/metaschema_modules_public/tables/{secrets_module → user_state_module}/table.sql +4 -4
- package/package.json +4 -4
- package/pgpm.plan +6 -3
- package/revert/schemas/metaschema_modules_public/tables/config_secrets_org_module/table.sql +7 -0
- package/revert/schemas/metaschema_modules_public/tables/config_secrets_user_module/table.sql +7 -0
- package/revert/schemas/metaschema_modules_public/tables/events_module/table.sql +7 -0
- package/revert/schemas/metaschema_modules_public/tables/inference_log_module/table.sql +3 -0
- package/revert/schemas/metaschema_modules_public/tables/rate_limit_meters_module/table.sql +7 -0
- package/revert/schemas/metaschema_modules_public/tables/user_state_module/table.sql +7 -0
- package/sql/metaschema-modules--0.15.5.sql +325 -195
- package/verify/schemas/metaschema_modules_public/tables/config_secrets_org_module/table.sql +7 -0
- package/verify/schemas/metaschema_modules_public/tables/config_secrets_user_module/table.sql +7 -0
- package/verify/schemas/metaschema_modules_public/tables/events_module/table.sql +7 -0
- package/verify/schemas/metaschema_modules_public/tables/inference_log_module/table.sql +21 -0
- package/verify/schemas/metaschema_modules_public/tables/rate_limit_meters_module/table.sql +7 -0
- package/verify/schemas/metaschema_modules_public/tables/user_state_module/table.sql +7 -0
- package/deploy/schemas/metaschema_modules_public/tables/levels_module/table.sql +0 -64
- package/deploy/schemas/metaschema_modules_public/tables/table_template_module/table.sql +0 -43
- package/revert/schemas/metaschema_modules_public/tables/encrypted_secrets_module/table.sql +0 -7
- package/revert/schemas/metaschema_modules_public/tables/levels_module/table.sql +0 -7
- package/revert/schemas/metaschema_modules_public/tables/secrets_module/table.sql +0 -7
- package/revert/schemas/metaschema_modules_public/tables/table_template_module/table.sql +0 -7
- package/verify/schemas/metaschema_modules_public/tables/encrypted_secrets_module/table.sql +0 -7
- package/verify/schemas/metaschema_modules_public/tables/levels_module/table.sql +0 -7
- package/verify/schemas/metaschema_modules_public/tables/secrets_module/table.sql +0 -7
- package/verify/schemas/metaschema_modules_public/tables/table_template_module/table.sql +0 -18
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Verify schemas/metaschema_modules_public/tables/inference_log_module/table on pg
|
|
2
|
+
|
|
3
|
+
BEGIN;
|
|
4
|
+
|
|
5
|
+
SELECT
|
|
6
|
+
id,
|
|
7
|
+
database_id,
|
|
8
|
+
schema_id,
|
|
9
|
+
private_schema_id,
|
|
10
|
+
inference_log_table_id,
|
|
11
|
+
inference_log_table_name,
|
|
12
|
+
usage_daily_table_id,
|
|
13
|
+
usage_daily_table_name,
|
|
14
|
+
"interval",
|
|
15
|
+
retention,
|
|
16
|
+
premake,
|
|
17
|
+
prefix
|
|
18
|
+
FROM metaschema_modules_public.inference_log_module
|
|
19
|
+
WHERE FALSE;
|
|
20
|
+
|
|
21
|
+
ROLLBACK;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
-- Deploy schemas/metaschema_modules_public/tables/levels_module/table to pg
|
|
2
|
-
|
|
3
|
-
-- requires: schemas/metaschema_modules_public/schema
|
|
4
|
-
|
|
5
|
-
BEGIN;
|
|
6
|
-
|
|
7
|
-
CREATE TABLE metaschema_modules_public.levels_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
|
-
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
14
|
-
--
|
|
15
|
-
|
|
16
|
-
steps_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
17
|
-
steps_table_name text NOT NULL DEFAULT '',
|
|
18
|
-
|
|
19
|
-
achievements_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
20
|
-
achievements_table_name text NOT NULL DEFAULT '',
|
|
21
|
-
|
|
22
|
-
levels_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
23
|
-
levels_table_name text NOT NULL DEFAULT '',
|
|
24
|
-
|
|
25
|
-
level_requirements_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
26
|
-
level_requirements_table_name text NOT NULL DEFAULT '',
|
|
27
|
-
|
|
28
|
-
completed_step text NOT NULL DEFAULT '',
|
|
29
|
-
incompleted_step text NOT NULL DEFAULT '',
|
|
30
|
-
tg_achievement text NOT NULL DEFAULT '',
|
|
31
|
-
tg_achievement_toggle text NOT NULL DEFAULT '',
|
|
32
|
-
tg_achievement_toggle_boolean text NOT NULL DEFAULT '',
|
|
33
|
-
tg_achievement_boolean text NOT NULL DEFAULT '',
|
|
34
|
-
upsert_achievement text NOT NULL DEFAULT '',
|
|
35
|
-
tg_update_achievements text NOT NULL DEFAULT '',
|
|
36
|
-
steps_required text NOT NULL DEFAULT '',
|
|
37
|
-
level_achieved text NOT NULL DEFAULT '',
|
|
38
|
-
|
|
39
|
-
prefix text NULL,
|
|
40
|
-
|
|
41
|
-
membership_type int NOT NULL,
|
|
42
|
-
-- if this is NOT NULL, then we add entity_id
|
|
43
|
-
-- e.g. limits to the app itself are considered global owned by app and no explicit owner
|
|
44
|
-
entity_table_id uuid NULL,
|
|
45
|
-
|
|
46
|
-
-- required tables
|
|
47
|
-
actor_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
|
|
51
|
-
CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
52
|
-
CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
53
|
-
|
|
54
|
-
CONSTRAINT steps_table_fkey FOREIGN KEY (steps_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
55
|
-
CONSTRAINT achievements_table_fkey FOREIGN KEY (achievements_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
56
|
-
CONSTRAINT levels_table_fkey FOREIGN KEY (levels_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
57
|
-
CONSTRAINT level_requirements_table_fkey FOREIGN KEY (level_requirements_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
58
|
-
CONSTRAINT entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
59
|
-
CONSTRAINT actor_table_fkey FOREIGN KEY (actor_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
CREATE INDEX user_status_module_database_id_idx ON metaschema_modules_public.levels_module ( database_id );
|
|
63
|
-
|
|
64
|
-
COMMIT;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
-- Deploy schemas/metaschema_modules_public/tables/table_template_module/table to pg
|
|
2
|
-
|
|
3
|
-
-- requires: schemas/metaschema_modules_public/schema
|
|
4
|
-
|
|
5
|
-
BEGIN;
|
|
6
|
-
|
|
7
|
-
CREATE TABLE metaschema_modules_public.table_template_module (
|
|
8
|
-
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
9
|
-
database_id uuid NOT NULL,
|
|
10
|
-
|
|
11
|
-
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
12
|
-
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
13
|
-
|
|
14
|
-
table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
15
|
-
owner_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
16
|
-
|
|
17
|
-
table_name text NOT NULL,
|
|
18
|
-
|
|
19
|
-
-- Node type (e.g., 'TableUserProfiles', 'TableOrganizationSettings', 'TableUserSettings')
|
|
20
|
-
node_type text NOT NULL,
|
|
21
|
-
|
|
22
|
-
-- Type-specific parameters as jsonb
|
|
23
|
-
-- TableUserProfiles: {} (uses default fields)
|
|
24
|
-
-- TableOrganizationSettings: {} (uses default fields)
|
|
25
|
-
-- TableUserSettings: {} (uses default fields)
|
|
26
|
-
data jsonb NOT NULL DEFAULT '{}',
|
|
27
|
-
|
|
28
|
-
--
|
|
29
|
-
CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
|
|
30
|
-
CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
31
|
-
CONSTRAINT owner_table_fkey FOREIGN KEY (owner_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
32
|
-
CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
33
|
-
CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
CREATE INDEX table_template_module_database_id_idx ON metaschema_modules_public.table_template_module ( database_id );
|
|
37
|
-
CREATE INDEX table_template_module_schema_id_idx ON metaschema_modules_public.table_template_module ( schema_id );
|
|
38
|
-
CREATE INDEX table_template_module_private_schema_id_idx ON metaschema_modules_public.table_template_module ( private_schema_id );
|
|
39
|
-
CREATE INDEX table_template_module_table_id_idx ON metaschema_modules_public.table_template_module ( table_id );
|
|
40
|
-
CREATE INDEX table_template_module_owner_table_id_idx ON metaschema_modules_public.table_template_module ( owner_table_id );
|
|
41
|
-
CREATE INDEX table_template_module_node_type_idx ON metaschema_modules_public.table_template_module ( node_type );
|
|
42
|
-
|
|
43
|
-
COMMIT;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
-- Verify schemas/metaschema_modules_public/tables/table_template_module/table on pg
|
|
2
|
-
|
|
3
|
-
BEGIN;
|
|
4
|
-
|
|
5
|
-
SELECT
|
|
6
|
-
id,
|
|
7
|
-
database_id,
|
|
8
|
-
schema_id,
|
|
9
|
-
private_schema_id,
|
|
10
|
-
table_id,
|
|
11
|
-
owner_table_id,
|
|
12
|
-
table_name,
|
|
13
|
-
node_type,
|
|
14
|
-
data
|
|
15
|
-
FROM metaschema_modules_public.table_template_module
|
|
16
|
-
WHERE FALSE;
|
|
17
|
-
|
|
18
|
-
ROLLBACK;
|