Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pgpm/core/src/modules/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const PGPM_MODULE_MAP: Record<string, string> = {
'pgpm-totp': '@pgpm/totp',
'pgpm-types': '@pgpm/types',
'pgpm-utils': '@pgpm/utils',
'pgpm-ltree-helpers': '@pgpm/ltree-helpers'
'pgpm-ltree-helpers': '@pgpm/ltree-helpers',
'pgpm-partman': '@pgpm/partman'
};

/**
Expand Down
106 changes: 72 additions & 34 deletions pgpm/export/src/export-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ export const DB_REQUIRED_EXTENSIONS = [
'ltree',
'metaschema-schema',
'pgpm-inflection',
'pgpm-uuid',
'pgpm-utils',
'pgpm-database-jobs',
'pgpm-jwt-claims',
'pgpm-stamps',
'pgpm-base32',
'pgpm-totp',
'pgpm-types',
'pgpm-ltree-helpers'
'pgpm-ltree-helpers',
'pgpm-partman'
] as const;

/**
Expand Down Expand Up @@ -162,7 +162,7 @@ export const META_TABLE_ORDER = [
'memberships_module',
'permissions_module',
'limits_module',
'levels_module',
'events_module',
'users_module',
'hierarchy_module',
'membership_types_module',
Expand All @@ -182,7 +182,8 @@ export const META_TABLE_ORDER = [
'uuid_module',
'default_ids_module',
'denormalized_table_field',
'table_template_module',
// NOTE: blueprint_template, blueprint, and blueprint_construction are intentionally
// excluded from the export flow — they are runtime-only tables not exported as metadata.
'relation_provision',
'entity_type_provision',
'rate_limits_module',
Expand All @@ -197,7 +198,9 @@ export const META_TABLE_ORDER = [
'session_secrets_module',
'config_secrets_org_module',
'webauthn_auth_module',
'webauthn_credentials_module'
'webauthn_credentials_module',
'inference_log_module',
'rate_limit_meters_module'
] as const;

// =============================================================================
Expand Down Expand Up @@ -822,32 +825,45 @@ export const META_TABLE_CONFIG: Record<string, TableConfig> = {
actor_table_id: 'uuid'
}
},
levels_module: {
events_module: {
schema: 'metaschema_modules_public',
table: 'levels_module',
table: 'events_module',
fields: {
id: 'uuid',
database_id: 'uuid',
schema_id: 'uuid',
private_schema_id: 'uuid',
steps_table_id: 'uuid',
steps_table_name: 'text',
achievements_table_id: 'uuid',
achievements_table_name: 'text',
events_table_id: 'uuid',
events_table_name: 'text',
event_aggregates_table_id: 'uuid',
event_aggregates_table_name: 'text',
event_types_table_id: 'uuid',
event_types_table_name: 'text',
levels_table_id: 'uuid',
levels_table_name: 'text',
level_requirements_table_id: 'uuid',
level_requirements_table_name: 'text',
completed_step: 'text',
incompleted_step: 'text',
tg_achievement: 'text',
tg_achievement_toggle: 'text',
tg_achievement_toggle_boolean: 'text',
tg_achievement_boolean: 'text',
upsert_achievement: 'text',
tg_update_achievements: 'text',
level_grants_table_id: 'uuid',
level_grants_table_name: 'text',
achievement_rewards_table_id: 'uuid',
achievement_rewards_table_name: 'text',
record_event: 'text',
remove_event: 'text',
tg_event: 'text',
tg_event_toggle: 'text',
tg_event_toggle_bool: 'text',
tg_event_bool: 'text',
upsert_aggregate: 'text',
tg_update_aggregates: 'text',
prune_events: 'text',
steps_required: 'text',
level_achieved: 'text',
tg_check_achievements: 'text',
grant_achievement: 'text',
tg_achievement_reward: 'text',
interval: 'text',
retention: 'text',
premake: 'int',
prefix: 'text',
membership_type: 'int',
entity_table_id: 'uuid',
Expand Down Expand Up @@ -1087,21 +1103,7 @@ export const META_TABLE_CONFIG: Record<string, TableConfig> = {
fields: 'uuid[]'
}
},
table_template_module: {
schema: 'metaschema_modules_public',
table: 'table_template_module',
fields: {
id: 'uuid',
database_id: 'uuid',
schema_id: 'uuid',
private_schema_id: 'uuid',
table_id: 'uuid',
owner_table_id: 'uuid',
table_name: 'text',
node_type: 'text',
data: 'jsonb'
}
},
// NOTE: table_template_module has been removed from pgpm-modules (superseded by blueprints)
secure_table_provision: {
schema: 'metaschema_modules_public',
table: 'secure_table_provision',
Expand Down Expand Up @@ -1456,6 +1458,42 @@ export const META_TABLE_CONFIG: Record<string, TableConfig> = {
table_name: 'text'
}
},
inference_log_module: {
schema: 'metaschema_modules_public',
table: 'inference_log_module',
fields: {
id: 'uuid',
database_id: 'uuid',
schema_id: 'uuid',
private_schema_id: 'uuid',
inference_log_table_id: 'uuid',
inference_log_table_name: 'text',
usage_daily_table_id: 'uuid',
usage_daily_table_name: 'text',
interval: 'text',
retention: 'text',
premake: 'int',
prefix: 'text'
}
},
rate_limit_meters_module: {
schema: 'metaschema_modules_public',
table: 'rate_limit_meters_module',
fields: {
id: 'uuid',
database_id: 'uuid',
schema_id: 'uuid',
private_schema_id: 'uuid',
rate_limit_state_table_id: 'uuid',
rate_limit_state_table_name: 'text',
rate_limit_overrides_table_id: 'uuid',
rate_limit_overrides_table_name: 'text',
rate_window_limits_table_id: 'uuid',
rate_window_limits_table_name: 'text',
check_rate_limit_function: 'text',
prefix: 'text'
}
},
spatial_relation: {
schema: 'metaschema_public',
table: 'spatial_relation',
Expand Down
Loading