feat: add metaschema_public.enum table schema#46
Open
pyramation wants to merge 2 commits intomainfrom
Open
Conversation
- Add enum table with id, database_id, schema_id, name, values text[], plus standard metadata columns - FKs to database and schema tables, UNIQUE(schema_id, name) - Indexes on schema_id and database_id - Deploy/revert/verify migration files - Update pgpm.plan and compiled SQL
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add metaschema_public.enum table schema
Summary
Adds a new
metaschema_public.enumtable to track PostgreSQL ENUM types in the metaschema. This is the upstream schema definition that corresponds to the triggers and compilation logic merged in constructive-db#581.Table columns:
id(uuid PK),database_id(FK → database),schema_id(FK → schema),name,values text[], plus standard metadata (label,description,smart_tags,category,module,scope,tags).Constraints:
UNIQUE(schema_id, name), cascade deletes from parent database/schema.Files added/modified:
deploy/schemas/metaschema_public/tables/enum/table.sql— CREATE TABLErevert/.../table.sql— DROP TABLEverify/.../table.sql— verify_table callpgpm.plan— new entry with dependencies on schema, database, schema table, and object_category typesql/metaschema-schema--0.15.5.sql— appended compiled SQLUpdates since last revision
metaschema-modulessnapshot:constraintCountchanged from100951→104821in the "foreign key relationships" test, reflecting the additional FK constraints (db_fkey,schema_fkey) and unique constraint introduced by the new enum table.Review & Testing Checklist for Human
constraintCountsnapshot (69984) doesn't also need updating. Only the100951 → 104821snapshot was reported as failing and updated. The69984snapshot ("database_id foreign keys" test) may also be affected — runpnpm testinpackages/metaschema-modulesto confirm.valuesas a column name works in all contexts.valuesis a SQL reserved word. PostgreSQL allows it as a column name, but verify it doesn't cause issues with PL/pgSQL triggers (in constructive-db#581) that referenceNEW.values/OLD.values.uuid_generate_v4 ()vsuuid_generate_v4(),E'@omit'vs'@omit').pgpm deployandpgpm revertto confirm the migration applies and rolls back cleanly.Notes
metaschema-schema--0.15.5.sql) appears to be missing some tables that exist in thepgpm.plan(e.g.view,view_table,view_grant,view_rule,default_privilege). This is a pre-existing gap, not introduced by this PR.