diff --git a/packages/achievements/jest.config.js b/packages/achievements/jest.config.js
index db566b12..4b2db888 100644
--- a/packages/achievements/jest.config.js
+++ b/packages/achievements/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
maxWorkers: 1,
diff --git a/packages/base32/jest.config.js b/packages/base32/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/base32/jest.config.js
+++ b/packages/base32/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/database-jobs/jest.config.js b/packages/database-jobs/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/database-jobs/jest.config.js
+++ b/packages/database-jobs/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/defaults/jest.config.js b/packages/defaults/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/defaults/jest.config.js
+++ b/packages/defaults/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/encrypted-secrets-table/jest.config.js b/packages/encrypted-secrets-table/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/encrypted-secrets-table/jest.config.js
+++ b/packages/encrypted-secrets-table/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/encrypted-secrets/jest.config.js b/packages/encrypted-secrets/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/encrypted-secrets/jest.config.js
+++ b/packages/encrypted-secrets/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/faker/jest.config.js b/packages/faker/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/faker/jest.config.js
+++ b/packages/faker/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/geotypes/jest.config.js b/packages/geotypes/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/geotypes/jest.config.js
+++ b/packages/geotypes/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/inflection/jest.config.js b/packages/inflection/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/inflection/jest.config.js
+++ b/packages/inflection/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/jobs/jest.config.js b/packages/jobs/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/jobs/jest.config.js
+++ b/packages/jobs/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/jwt-claims/jest.config.js b/packages/jwt-claims/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/jwt-claims/jest.config.js
+++ b/packages/jwt-claims/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/measurements/jest.config.js b/packages/measurements/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/measurements/jest.config.js
+++ b/packages/measurements/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/metaschema-modules/README.md b/packages/metaschema-modules/README.md
index d4bcbf32..535f67c8 100644
--- a/packages/metaschema-modules/README.md
+++ b/packages/metaschema-modules/README.md
@@ -95,7 +95,7 @@ The package provides metadata tables for the following modules:
- **permissions_module**: Permission system configuration
- **memberships_module**: Membership management settings
- **membership_types_module**: Membership type definitions
-- **levels_module**: User level configurations
+- **events_module**: User level configurations
### Security
- **encrypted_secrets_module**: Encrypted secrets configuration
diff --git a/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap b/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap
index 669f4b62..bdab1fc5 100644
--- a/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap
+++ b/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap
@@ -5,17 +5,19 @@ exports[`db_meta_modules should have all expected module tables 1`] = `
"moduleNames": [
"billing_module",
"billing_provider_module",
+ "config_secrets_org_module",
+ "config_secrets_user_module",
"connected_accounts_module",
"crypto_addresses_module",
"crypto_auth_module",
"default_ids_module",
"devices_module",
"emails_module",
- "encrypted_secrets_module",
+ "events_module",
"hierarchy_module",
"identity_providers_module",
+ "inference_log_module",
"invites_module",
- "levels_module",
"limits_module",
"membership_types_module",
"memberships_module",
@@ -24,14 +26,15 @@ exports[`db_meta_modules should have all expected module tables 1`] = `
"phone_numbers_module",
"plans_module",
"profiles_module",
+ "rate_limit_meters_module",
"rate_limits_module",
"realtime_module",
"rls_module",
- "secrets_module",
"session_secrets_module",
"sessions_module",
"storage_module",
"user_auth_module",
+ "user_state_module",
"users_module",
"webauthn_auth_module",
"webauthn_credentials_module",
@@ -41,8 +44,8 @@ exports[`db_meta_modules should have all expected module tables 1`] = `
exports[`db_meta_modules should verify all module tables exist in metaschema_modules_public schema 1`] = `
{
- "moduleTablesCount": 32,
- "totalTables": 39,
+ "moduleTablesCount": 35,
+ "totalTables": 42,
}
`;
@@ -97,13 +100,13 @@ exports[`db_meta_modules should verify emails_module table structure 1`] = `
exports[`db_meta_modules should verify module table structures have database_id foreign keys 1`] = `
{
- "constraintCount": 165888,
+ "constraintCount": 196875,
}
`;
exports[`db_meta_modules should verify module tables have proper foreign key relationships 1`] = `
{
- "constraintCount": 238227,
+ "constraintCount": 286927,
"foreignTables": [
"database",
"field",
diff --git a/packages/metaschema-modules/__tests__/modules.test.ts b/packages/metaschema-modules/__tests__/modules.test.ts
index 61300f8a..70be2d69 100644
--- a/packages/metaschema-modules/__tests__/modules.test.ts
+++ b/packages/metaschema-modules/__tests__/modules.test.ts
@@ -27,16 +27,16 @@ describe('db_meta_modules', () => {
'crypto_auth_module',
'default_ids_module',
'emails_module',
- 'encrypted_secrets_module',
+ 'config_secrets_user_module',
'invites_module',
- 'levels_module',
+ 'events_module',
'limits_module',
'membership_types_module',
'memberships_module',
'permissions_module',
'phone_numbers_module',
'rls_module',
- 'secrets_module',
+ 'user_state_module',
'sessions_module',
'user_auth_module',
'users_module'
@@ -252,4 +252,4 @@ describe('db_meta_modules', () => {
})).toMatchSnapshot();
});
-});
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/billing_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/billing_module/table.sql
index ac181e49..f13957e9 100644
--- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/billing_module/table.sql
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/billing_module/table.sql
@@ -27,6 +27,10 @@ CREATE TABLE metaschema_modules_public.billing_module (
balances_table_id uuid NOT NULL DEFAULT uuid_nil(),
balances_table_name text NOT NULL DEFAULT '',
+ -- Meter credits table: append-only credit grants for billing meters
+ meter_credits_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ meter_credits_table_name text NOT NULL DEFAULT '',
+
-- Generated functions
record_usage_function text NOT NULL DEFAULT '',
@@ -39,6 +43,7 @@ CREATE TABLE metaschema_modules_public.billing_module (
CONSTRAINT plan_subscriptions_table_fkey FOREIGN KEY (plan_subscriptions_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
CONSTRAINT ledger_table_fkey FOREIGN KEY (ledger_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
CONSTRAINT balances_table_fkey FOREIGN KEY (balances_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT meter_credits_table_fkey FOREIGN KEY (meter_credits_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
CONSTRAINT billing_module_database_id_unique UNIQUE (database_id)
);
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/config_secrets_org_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/config_secrets_org_module/table.sql
new file mode 100644
index 00000000..dba9b605
--- /dev/null
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/config_secrets_org_module/table.sql
@@ -0,0 +1,28 @@
+-- Deploy schemas/metaschema_modules_public/tables/config_secrets_org_module/table to pg
+
+-- requires: schemas/metaschema_modules_public/schema
+
+BEGIN;
+
+CREATE TABLE metaschema_modules_public.config_secrets_org_module (
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
+ database_id uuid NOT NULL,
+
+ --
+ schema_id uuid NOT NULL DEFAULT uuid_nil(),
+ table_id uuid NOT NULL DEFAULT uuid_nil(),
+ table_name text NOT NULL DEFAULT 'org_secrets',
+ --
+
+ CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
+ CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
+ CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
+);
+
+CREATE INDEX config_secrets_org_module_database_id_idx ON metaschema_modules_public.config_secrets_org_module ( database_id );
+CREATE INDEX config_secrets_org_module_schema_id_idx ON metaschema_modules_public.config_secrets_org_module ( schema_id );
+CREATE INDEX config_secrets_org_module_table_id_idx ON metaschema_modules_public.config_secrets_org_module ( table_id );
+
+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.';
+
+COMMIT;
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/encrypted_secrets_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/config_secrets_user_module/table.sql
similarity index 63%
rename from packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/encrypted_secrets_module/table.sql
rename to packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/config_secrets_user_module/table.sql
index 33986785..690d3356 100644
--- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/encrypted_secrets_module/table.sql
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/config_secrets_user_module/table.sql
@@ -1,17 +1,17 @@
--- Deploy schemas/metaschema_modules_public/tables/encrypted_secrets_module/table to pg
+-- Deploy schemas/metaschema_modules_public/tables/config_secrets_user_module/table to pg
-- requires: schemas/metaschema_modules_public/schema
BEGIN;
-CREATE TABLE metaschema_modules_public.encrypted_secrets_module (
+CREATE TABLE metaschema_modules_public.config_secrets_user_module (
id uuid PRIMARY KEY DEFAULT uuidv7(),
database_id uuid NOT NULL,
--
schema_id uuid NOT NULL DEFAULT uuid_nil(),
table_id uuid NOT NULL DEFAULT uuid_nil(),
- table_name text NOT NULL DEFAULT 'encrypted_secrets',
+ table_name text NOT NULL DEFAULT 'user_secrets',
--
CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
@@ -19,6 +19,6 @@ CREATE TABLE metaschema_modules_public.encrypted_secrets_module (
CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
);
-CREATE INDEX encrypted_secrets_module_database_id_idx ON metaschema_modules_public.encrypted_secrets_module ( database_id );
+CREATE INDEX config_secrets_user_module_database_id_idx ON metaschema_modules_public.config_secrets_user_module ( database_id );
COMMIT;
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/entity_type_provision/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/entity_type_provision/table.sql
index 09f2a6af..8e5f2b78 100644
--- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/entity_type_provision/table.sql
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/entity_type_provision/table.sql
@@ -51,9 +51,13 @@ CREATE TABLE metaschema_modules_public.entity_type_provision (
has_invites boolean NOT NULL DEFAULT false,
+ has_invite_achievements boolean NOT NULL DEFAULT false,
+
-- =========================================================================
- -- Storage configuration: module-level overrides + initial bucket defs.
- -- Only used when has_storage = true. NULL = use defaults.
+ -- Storage configuration: JSON array of storage module definitions.
+ -- Each element provisions a separate storage module with its own tables,
+ -- RLS policies, and feature flags. Only used when has_storage = true.
+ -- NULL = provision a single default storage module with default settings.
-- =========================================================================
storage_config jsonb DEFAULT NULL,
@@ -197,7 +201,7 @@ COMMENT ON COLUMN metaschema_modules_public.entity_type_provision.has_profiles I
When true, creates profile tables and applies profiles security.';
COMMENT ON COLUMN metaschema_modules_public.entity_type_provision.has_levels IS
- 'Whether to provision levels_module for this type. Defaults to false.
+ 'Whether to provision events_module for this type. Defaults to false.
Levels provide gamification/achievement tracking for members.
When true, creates level steps, achievements, and level tables with security.';
@@ -216,6 +220,15 @@ COMMENT ON COLUMN metaschema_modules_public.entity_type_provision.has_invites IS
UNIQUE (database_id, membership_type) constraint on invites_module combined with
ON CONFLICT DO NOTHING in the fan-out makes repeated INSERTs safe.';
+COMMENT ON COLUMN metaschema_modules_public.entity_type_provision.has_invite_achievements IS
+ 'Whether to auto-attach an EventTracker to the claimed_invites table for invite-based
+ achievements. Defaults to false. Requires has_invites=true AND has_levels=true.
+ When true, the trigger calls event_tracker() on the claimed_invites table with
+ event_name=''invite_claimed'', actor_field=''sender_id'', events=[''INSERT''],
+ crediting the SENDER (inviter) when someone claims their invite code.
+ Developers can then define achievements in the blueprint achievements[] section
+ that reference the ''invite_claimed'' event (e.g., "Invite 5 friends" = count: 5).';
+
-- =============================================================================
-- Escape hatch
-- =============================================================================
@@ -284,36 +297,34 @@ COMMENT ON COLUMN metaschema_modules_public.entity_type_provision.out_installed_
Populated by the trigger. Useful for verifying which modules were provisioned.';
COMMENT ON COLUMN metaschema_modules_public.entity_type_provision.storage_config IS
- 'Optional jsonb object for storage module configuration and initial bucket seeding.
- Only used when has_storage = true; ignored otherwise. NULL = use defaults.
- Recognized keys (all optional):
- - upload_url_expiry_seconds (integer) presigned PUT URL expiry override
- - download_url_expiry_seconds (integer) presigned GET URL expiry override
- - default_max_file_size (bigint) global max file size in bytes for this scope
- - allowed_origins (text[]) default CORS origins for all buckets in this scope
- - buckets (jsonb[]) array of initial bucket definitions to seed
- Each bucket in the buckets array recognizes:
- - name (text, required) bucket name e.g. ''documents''
- - description (text) human-readable description
- - is_public (boolean) whether files are publicly readable (default false)
- - allowed_mime_types (text[]) whitelist of MIME types (null = any)
- - max_file_size (bigint) max file size in bytes (null = use scope default)
- - allowed_origins (text[]) per-bucket CORS override
- - provisions (jsonb object) optional: customize storage tables
- with additional nodes, fields, grants, and policies.
- Keyed by table role: "files", "buckets".
- Each value uses the same shape as table_provision:
- { nodes, fields, grants, use_rls, policies }. Fanned out
- to secure_table_provision targeting the corresponding table.
- When a key includes policies[], those REPLACE the default
- storage policies for that table; tables without a key still
- get defaults. Missing "data" on policy entries is auto-populated
- with storage-specific defaults (same as table_provision).
- Example: add SearchBm25 for full-text search on files:
- {"provisions": {"files": {"nodes": [{"$type":
- "SearchBm25", "data": {"source_fields": ["description"]}}]}}}
- Example:
- storage_config := ''{"buckets": [{"name": "documents", "is_public": false, "allowed_mime_types": ["application/pdf"]}], "provisions": {"files": {"nodes": [{"$type": "SearchBm25", "data": {"source_fields": ["description"]}}]}}}''::jsonb';
+ 'Optional JSON array of storage module definitions. Each element provisions a separate
+ storage module with its own tables ({prefix}_{storage_key}_buckets/files), RLS policies,
+ and feature flags. Only used when has_storage = true; ignored otherwise.
+ NULL = provision a single default storage module with all defaults.
+ Each array element recognizes (all optional):
+ - storage_key (text) module discriminator, max 16 chars, lowercase snake_case.
+ Defaults to ''default'' (omitted from table names).
+ Non-default keys become infixes: {prefix}_{key}_buckets.
+ - upload_url_expiry_seconds (integer) presigned PUT URL expiry override
+ - download_url_expiry_seconds (integer) presigned GET URL expiry override
+ - default_max_file_size (bigint) global max file size in bytes for this module
+ - allowed_origins (text[]) default CORS origins for all buckets in this module
+ - restrict_reads (boolean) require read_files permission for SELECT on files
+ - has_path_shares (boolean) enable virtual filesystem + path share policies
+ - has_versioning (boolean) enable file version chains
+ - has_content_hash (boolean) enable content hash for dedup
+ - has_custom_keys (boolean) allow client-provided S3 keys
+ - has_audit_log (boolean) enable file events audit table
+ - has_confirm_upload (boolean) enable HeadObject confirmation flow
+ - confirm_upload_delay (interval) delay before first confirmation attempt
+ - buckets (jsonb[]) array of initial bucket definitions to seed.
+ Each bucket: { name (required), description, is_public, allowed_mime_types, max_file_size, allowed_origins }
+ - provisions (jsonb object) per-table customization keyed by "files" or "buckets".
+ Each value: { nodes, fields, grants, use_rls, policies }.
+ Example (single module, backward compat):
+ storage_config := ''[{"buckets": [{"name": "documents"}]}]''::jsonb
+ Example (multi-module):
+ storage_config := ''[{"has_path_shares": true, "buckets": [{"name": "documents"}]}, {"storage_key": "fn", "has_custom_keys": true, "buckets": [{"name": "functions"}]}]''::jsonb';
COMMENT ON COLUMN metaschema_modules_public.entity_type_provision.out_storage_module_id IS
'Output: the UUID of the storage_module row created for this entity type. Populated by the trigger when has_storage=true.';
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/events_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/events_module/table.sql
new file mode 100644
index 00000000..5e368c9a
--- /dev/null
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/events_module/table.sql
@@ -0,0 +1,85 @@
+-- Deploy schemas/metaschema_modules_public/tables/events_module/table to pg
+
+-- requires: schemas/metaschema_modules_public/schema
+
+BEGIN;
+
+CREATE TABLE metaschema_modules_public.events_module (
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
+ database_id uuid NOT NULL,
+
+ --
+ schema_id uuid NOT NULL DEFAULT uuid_nil(),
+ private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
+ --
+
+ events_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ events_table_name text NOT NULL DEFAULT '',
+
+ event_aggregates_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ event_aggregates_table_name text NOT NULL DEFAULT '',
+
+ event_types_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ event_types_table_name text NOT NULL DEFAULT '',
+
+ levels_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ levels_table_name text NOT NULL DEFAULT '',
+
+ level_requirements_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ level_requirements_table_name text NOT NULL DEFAULT '',
+
+ level_grants_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ level_grants_table_name text NOT NULL DEFAULT '',
+
+ achievement_rewards_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ achievement_rewards_table_name text NOT NULL DEFAULT '',
+
+ record_event text NOT NULL DEFAULT '',
+ remove_event text NOT NULL DEFAULT '',
+ tg_event text NOT NULL DEFAULT '',
+ tg_event_toggle text NOT NULL DEFAULT '',
+ tg_event_toggle_bool text NOT NULL DEFAULT '',
+ tg_event_bool text NOT NULL DEFAULT '',
+ upsert_aggregate text NOT NULL DEFAULT '',
+ tg_update_aggregates text NOT NULL DEFAULT '',
+ prune_events text NOT NULL DEFAULT '',
+ steps_required text NOT NULL DEFAULT '',
+ level_achieved text NOT NULL DEFAULT '',
+ tg_check_achievements text NOT NULL DEFAULT '',
+ grant_achievement text NOT NULL DEFAULT '',
+ tg_achievement_reward text NOT NULL DEFAULT '',
+
+ -- Partition lifecycle configuration for events table
+ "interval" text NOT NULL DEFAULT '1 month',
+ retention text DEFAULT '12 months',
+ premake int NOT NULL DEFAULT 2,
+
+ prefix text NULL,
+
+ membership_type int NOT NULL,
+ -- if this is NOT NULL, then we add entity_id
+ -- e.g. limits to the app itself are considered global owned by app and no explicit owner
+ entity_table_id uuid NULL,
+
+ -- required tables
+ actor_table_id uuid NOT NULL DEFAULT uuid_nil(),
+
+
+ CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
+ CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
+ CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
+
+ CONSTRAINT events_table_fkey FOREIGN KEY (events_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT event_aggregates_table_fkey FOREIGN KEY (event_aggregates_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT event_types_table_fkey FOREIGN KEY (event_types_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT levels_table_fkey FOREIGN KEY (levels_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT level_requirements_table_fkey FOREIGN KEY (level_requirements_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT level_grants_table_fkey FOREIGN KEY (level_grants_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT achievement_rewards_table_fkey FOREIGN KEY (achievement_rewards_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT actor_table_fkey FOREIGN KEY (actor_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
+);
+
+CREATE INDEX events_module_database_id_idx ON metaschema_modules_public.events_module ( database_id );
+
+COMMIT;
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/inference_log_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/inference_log_module/table.sql
new file mode 100644
index 00000000..c12f26e9
--- /dev/null
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/inference_log_module/table.sql
@@ -0,0 +1,39 @@
+-- Deploy schemas/metaschema_modules_public/tables/inference_log_module/table to pg
+
+-- requires: schemas/metaschema_modules_public/schema
+
+BEGIN;
+
+CREATE TABLE metaschema_modules_public.inference_log_module (
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
+ database_id uuid NOT NULL,
+
+ schema_id uuid NOT NULL DEFAULT uuid_nil(),
+ private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
+
+ -- Inference log table (partitioned by created_at)
+ inference_log_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ inference_log_table_name text NOT NULL DEFAULT '',
+
+ -- Pre-aggregated daily rollup table
+ usage_daily_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ usage_daily_table_name text NOT NULL DEFAULT '',
+
+ -- Partition lifecycle configuration
+ "interval" text NOT NULL DEFAULT '1 month',
+ retention text NULL,
+ premake int NOT NULL DEFAULT 2,
+
+ prefix text NULL,
+
+ CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
+ CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
+ CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
+ CONSTRAINT inference_log_table_fkey FOREIGN KEY (inference_log_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT usage_daily_table_fkey FOREIGN KEY (usage_daily_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT inference_log_module_database_id_unique UNIQUE (database_id)
+);
+
+CREATE INDEX inference_log_module_database_id_idx ON metaschema_modules_public.inference_log_module ( database_id );
+
+COMMIT;
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/levels_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/levels_module/table.sql
deleted file mode 100644
index d35ae245..00000000
--- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/levels_module/table.sql
+++ /dev/null
@@ -1,64 +0,0 @@
--- Deploy schemas/metaschema_modules_public/tables/levels_module/table to pg
-
--- requires: schemas/metaschema_modules_public/schema
-
-BEGIN;
-
-CREATE TABLE metaschema_modules_public.levels_module (
- id uuid PRIMARY KEY DEFAULT uuidv7(),
- database_id uuid NOT NULL,
-
- --
- schema_id uuid NOT NULL DEFAULT uuid_nil(),
- private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
- --
-
- steps_table_id uuid NOT NULL DEFAULT uuid_nil(),
- steps_table_name text NOT NULL DEFAULT '',
-
- achievements_table_id uuid NOT NULL DEFAULT uuid_nil(),
- achievements_table_name text NOT NULL DEFAULT '',
-
- levels_table_id uuid NOT NULL DEFAULT uuid_nil(),
- levels_table_name text NOT NULL DEFAULT '',
-
- level_requirements_table_id uuid NOT NULL DEFAULT uuid_nil(),
- level_requirements_table_name text NOT NULL DEFAULT '',
-
- completed_step text NOT NULL DEFAULT '',
- incompleted_step text NOT NULL DEFAULT '',
- tg_achievement text NOT NULL DEFAULT '',
- tg_achievement_toggle text NOT NULL DEFAULT '',
- tg_achievement_toggle_boolean text NOT NULL DEFAULT '',
- tg_achievement_boolean text NOT NULL DEFAULT '',
- upsert_achievement text NOT NULL DEFAULT '',
- tg_update_achievements text NOT NULL DEFAULT '',
- steps_required text NOT NULL DEFAULT '',
- level_achieved text NOT NULL DEFAULT '',
-
- prefix text NULL,
-
- membership_type int NOT NULL,
- -- if this is NOT NULL, then we add entity_id
- -- e.g. limits to the app itself are considered global owned by app and no explicit owner
- entity_table_id uuid NULL,
-
- -- required tables
- actor_table_id uuid NOT NULL DEFAULT uuid_nil(),
-
-
- CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
- CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
- CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
-
- CONSTRAINT steps_table_fkey FOREIGN KEY (steps_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
- CONSTRAINT achievements_table_fkey FOREIGN KEY (achievements_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
- CONSTRAINT levels_table_fkey FOREIGN KEY (levels_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
- CONSTRAINT level_requirements_table_fkey FOREIGN KEY (level_requirements_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
- CONSTRAINT entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
- CONSTRAINT actor_table_fkey FOREIGN KEY (actor_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
-);
-
-CREATE INDEX user_status_module_database_id_idx ON metaschema_modules_public.levels_module ( database_id );
-
-COMMIT;
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/limits_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/limits_module/table.sql
index c101eee9..ef7246b1 100644
--- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/limits_module/table.sql
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/limits_module/table.sql
@@ -53,6 +53,14 @@ CREATE TABLE metaschema_modules_public.limits_module (
-- Resolve cap function (COALESCE lookup: per-entity → default → 0)
resolve_cap_function text NOT NULL DEFAULT '',
+ -- Warning tables for soft-limit notifications
+ limit_warnings_table_id uuid NULL,
+ limit_warning_state_table_id uuid NULL,
+
+ -- Soft limit check functions
+ limit_check_soft_function text NOT NULL DEFAULT '',
+ limit_aggregate_check_soft_function text NOT NULL DEFAULT '',
+
prefix text NULL,
membership_type int NOT NULL,
@@ -77,7 +85,9 @@ CREATE TABLE metaschema_modules_public.limits_module (
CONSTRAINT credit_code_items_table_fkey FOREIGN KEY (credit_code_items_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
CONSTRAINT credit_redemptions_table_fkey FOREIGN KEY (credit_redemptions_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
CONSTRAINT limit_caps_table_fkey FOREIGN KEY (limit_caps_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
- CONSTRAINT limit_caps_defaults_table_fkey FOREIGN KEY (limit_caps_defaults_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
+ CONSTRAINT limit_caps_defaults_table_fkey FOREIGN KEY (limit_caps_defaults_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT limit_warnings_table_fkey FOREIGN KEY (limit_warnings_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT limit_warning_state_table_fkey FOREIGN KEY (limit_warning_state_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
);
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/rate_limit_meters_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/rate_limit_meters_module/table.sql
new file mode 100644
index 00000000..268a3522
--- /dev/null
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/rate_limit_meters_module/table.sql
@@ -0,0 +1,51 @@
+-- Deploy schemas/metaschema_modules_public/tables/rate_limit_meters_module/table to pg
+
+-- requires: schemas/metaschema_modules_public/schema
+
+BEGIN;
+
+CREATE TABLE metaschema_modules_public.rate_limit_meters_module (
+ id uuid PRIMARY KEY DEFAULT uuidv7(),
+ database_id uuid NOT NULL,
+
+ -- Public schema: rate_limit_overrides table (admin-manageable via GraphQL API)
+ schema_id uuid NOT NULL DEFAULT uuid_nil(),
+ -- Private schema: rate_limit_state table, check_rate_limit function (internal)
+ private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
+
+ -- State table: sliding window tracking per entity/actor/meter/window (private)
+ rate_limit_state_table_id uuid NOT NULL DEFAULT uuid_nil(),
+ rate_limit_state_table_name text NOT NULL DEFAULT '',
+
+ -- Overrides table: per-entity and per-actor rate limit overrides (public)
+ rate_limit_overrides_table_id uuid NULL,
+ rate_limit_overrides_table_name text NOT NULL DEFAULT '',
+
+ -- Rate window limits table: per-plan rate limit configuration (public)
+ rate_window_limits_table_id uuid NULL,
+ rate_window_limits_table_name text NOT NULL DEFAULT '',
+
+ -- Generated check function (private)
+ check_rate_limit_function text NOT NULL DEFAULT '',
+
+ prefix text NULL,
+
+ CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
+ CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
+ CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
+ CONSTRAINT rate_limit_state_table_fkey FOREIGN KEY (rate_limit_state_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT rate_limit_overrides_table_fkey FOREIGN KEY (rate_limit_overrides_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT rate_window_limits_table_fkey FOREIGN KEY (rate_window_limits_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
+ CONSTRAINT rate_limit_meters_module_database_id_unique UNIQUE (database_id)
+);
+
+CREATE INDEX rate_limit_meters_module_database_id_idx ON metaschema_modules_public.rate_limit_meters_module ( database_id );
+
+COMMENT ON CONSTRAINT rate_limit_state_table_fkey
+ ON metaschema_modules_public.rate_limit_meters_module IS E'@fieldName rateLimitStateTableByRateLimitStateTableId';
+COMMENT ON CONSTRAINT rate_limit_overrides_table_fkey
+ ON metaschema_modules_public.rate_limit_meters_module IS E'@fieldName rateLimitOverridesTableByRateLimitOverridesTableId';
+COMMENT ON CONSTRAINT rate_window_limits_table_fkey
+ ON metaschema_modules_public.rate_limit_meters_module IS E'@fieldName rateWindowLimitsTableByRateWindowLimitsTableId';
+
+COMMIT;
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/realtime_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/realtime_module/table.sql
index e5936787..a521e560 100644
--- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/realtime_module/table.sql
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/realtime_module/table.sql
@@ -20,8 +20,8 @@ CREATE TABLE metaschema_modules_public.realtime_module (
-- Partition lifecycle configuration for change_log
retention_hours integer NOT NULL DEFAULT 168,
- lookahead_hours integer NOT NULL DEFAULT 24,
- partition_interval text NOT NULL DEFAULT 'hourly',
+ premake int NOT NULL DEFAULT 7,
+ "interval" text NOT NULL DEFAULT '1 day',
-- NOTIFY hybrid wake-up channel name (NULL = use default)
notify_channel text NULL,
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/storage_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/storage_module/table.sql
index 5222d442..7e80b5f1 100644
--- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/storage_module/table.sql
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/storage_module/table.sql
@@ -23,6 +23,12 @@ CREATE TABLE metaschema_modules_public.storage_module (
-- Multi-tenant storage identity
membership_type int DEFAULT NULL, -- NULL = global gate (AuthzMembership via app_sprt), non-NULL = entity-scoped (AuthzEntityMembership)
+ -- Storage module discriminator: allows multiple storage modules per entity type.
+ -- 'default' is omitted from table names (backward compat), any other value becomes
+ -- an infix: {prefix}_{storage_key}_{buckets|files}.
+ -- Max 16 chars, lowercase snake_case, cannot be 'buckets'/'files'/'bucket'/'file'.
+ storage_key text NOT NULL DEFAULT 'default',
+
-- Configurable security policies (NULL = use defaults based on membership_type).
-- When provided, replaces the default policy set in apply_storage_security.
-- Accepts a JSON array of policy objects:
@@ -76,6 +82,8 @@ CREATE TABLE metaschema_modules_public.storage_module (
has_content_hash boolean NOT NULL DEFAULT false, -- Content hash column for dedup + integrity verification
has_custom_keys boolean NOT NULL DEFAULT false, -- allow_custom_keys on buckets (implies has_versioning + has_content_hash)
has_audit_log boolean NOT NULL DEFAULT false, -- File events audit table: upload, delete, move, rename, download, share events
+ has_confirm_upload boolean NOT NULL DEFAULT false, -- Deferred HeadObject confirmation: enqueues storage:confirm_upload job on INSERT, creates status transition functions
+ confirm_upload_delay interval NOT NULL DEFAULT '30 seconds', -- Delay before first confirmation attempt (only used when has_confirm_upload = true)
-- Generated table ID for file_events (populated by the generator when has_audit_log=true)
file_events_table_id uuid NULL DEFAULT NULL,
@@ -93,8 +101,9 @@ CREATE TABLE metaschema_modules_public.storage_module (
CREATE INDEX storage_module_database_id_idx ON metaschema_modules_public.storage_module ( database_id );
--- Unique constraint on (database_id, membership_type) using COALESCE to handle NULLs.
--- NULL membership_type = app-level (only one per database), non-NULL = entity-scoped (one per membership_type per database).
-CREATE UNIQUE INDEX storage_module_unique_scope ON metaschema_modules_public.storage_module ( database_id, COALESCE(membership_type, -1) );
+-- Unique constraint on (database_id, membership_type, storage_key) using COALESCE to handle NULLs.
+-- NULL membership_type = app-level, non-NULL = entity-scoped. storage_key discriminates
+-- multiple storage modules for the same entity type (e.g. 'default' + 'fn').
+CREATE UNIQUE INDEX storage_module_unique_scope ON metaschema_modules_public.storage_module ( database_id, COALESCE(membership_type, -1), storage_key );
COMMIT;
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/table_template_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/table_template_module/table.sql
deleted file mode 100644
index ef126735..00000000
--- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/table_template_module/table.sql
+++ /dev/null
@@ -1,43 +0,0 @@
--- Deploy schemas/metaschema_modules_public/tables/table_template_module/table to pg
-
--- requires: schemas/metaschema_modules_public/schema
-
-BEGIN;
-
-CREATE TABLE metaschema_modules_public.table_template_module (
- id uuid PRIMARY KEY DEFAULT uuidv7(),
- database_id uuid NOT NULL,
-
- schema_id uuid NOT NULL DEFAULT uuid_nil(),
- private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
-
- table_id uuid NOT NULL DEFAULT uuid_nil(),
- owner_table_id uuid NOT NULL DEFAULT uuid_nil(),
-
- table_name text NOT NULL,
-
- -- Node type (e.g., 'TableUserProfiles', 'TableOrganizationSettings', 'TableUserSettings')
- node_type text NOT NULL,
-
- -- Type-specific parameters as jsonb
- -- TableUserProfiles: {} (uses default fields)
- -- TableOrganizationSettings: {} (uses default fields)
- -- TableUserSettings: {} (uses default fields)
- data jsonb NOT NULL DEFAULT '{}',
-
- --
- CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
- CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
- CONSTRAINT owner_table_fkey FOREIGN KEY (owner_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
- CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
- CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE
-);
-
-CREATE INDEX table_template_module_database_id_idx ON metaschema_modules_public.table_template_module ( database_id );
-CREATE INDEX table_template_module_schema_id_idx ON metaschema_modules_public.table_template_module ( schema_id );
-CREATE INDEX table_template_module_private_schema_id_idx ON metaschema_modules_public.table_template_module ( private_schema_id );
-CREATE INDEX table_template_module_table_id_idx ON metaschema_modules_public.table_template_module ( table_id );
-CREATE INDEX table_template_module_owner_table_id_idx ON metaschema_modules_public.table_template_module ( owner_table_id );
-CREATE INDEX table_template_module_node_type_idx ON metaschema_modules_public.table_template_module ( node_type );
-
-COMMIT;
diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/secrets_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_state_module/table.sql
similarity index 66%
rename from packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/secrets_module/table.sql
rename to packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_state_module/table.sql
index c06e2a0c..521f5dce 100644
--- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/secrets_module/table.sql
+++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_state_module/table.sql
@@ -1,16 +1,16 @@
--- Deploy schemas/metaschema_modules_public/tables/secrets_module/table to pg
+-- Deploy schemas/metaschema_modules_public/tables/user_state_module/table to pg
-- requires: schemas/metaschema_modules_public/schema
BEGIN;
-CREATE TABLE metaschema_modules_public.secrets_module (
+CREATE TABLE metaschema_modules_public.user_state_module (
id uuid PRIMARY KEY DEFAULT uuidv7(),
database_id uuid NOT NULL,
--
schema_id uuid NOT NULL DEFAULT uuid_nil(),
table_id uuid NOT NULL DEFAULT uuid_nil(),
- table_name text NOT NULL DEFAULT 'secrets',
+ table_name text NOT NULL DEFAULT 'user_state',
--
CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
@@ -18,6 +18,6 @@ CREATE TABLE metaschema_modules_public.secrets_module (
);
-CREATE INDEX secrets_module_database_id_idx ON metaschema_modules_public.secrets_module ( database_id );
+CREATE INDEX user_state_module_database_id_idx ON metaschema_modules_public.user_state_module ( database_id );
COMMIT;
diff --git a/packages/metaschema-modules/jest.config.js b/packages/metaschema-modules/jest.config.js
index e20e7efb..4108cf46 100644
--- a/packages/metaschema-modules/jest.config.js
+++ b/packages/metaschema-modules/jest.config.js
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
+ forceExit: true,
preset: 'ts-jest',
testEnvironment: 'node',
diff --git a/packages/metaschema-modules/pgpm.plan b/packages/metaschema-modules/pgpm.plan
index dcb3bff2..75d13fc2 100644
--- a/packages/metaschema-modules/pgpm.plan
+++ b/packages/metaschema-modules/pgpm.plan
@@ -12,9 +12,9 @@ schemas/metaschema_modules_public/tables/crypto_auth_module/table [schemas/metas
schemas/metaschema_modules_public/tables/default_ids_module/table [schemas/metaschema_modules_public/schema] 2017-08-11T08:11:51Z skitch