feat(enum): add PostgreSQL enum type diffing#173
Merged
jasdeepkhalsa merged 4 commits intomasterfrom Apr 7, 2026
Merged
Conversation
Member
jasdeepkhalsa
commented
Apr 7, 2026
- Add CreateEnum, DropEnum, AlterEnum diff models
- Add CreateEnumSQL, DropEnumSQL, AlterEnumSQL generators
- Add getEnums() to DBAdapterInterface
- Implement getEnums() in PostgresAdapter (pg_type + pg_enum)
- Stub getEnums() in MySQLAdapter and SQLiteAdapter (return [])
- Add getEnums() delegation in DBManager
- Add diffEnums() in DBSchema, wired before views/tables
- Update DiffSorter: enum drops before view drops, creates before view creates
- Add EnumSQLTest (7 tests) and DiffSorter enum ordering tests (3 tests)
- Update README and copilot-instructions
- Add CreateEnum, DropEnum, AlterEnum diff models - Add CreateEnumSQL, DropEnumSQL, AlterEnumSQL generators - Add getEnums() to DBAdapterInterface - Implement getEnums() in PostgresAdapter (pg_type + pg_enum) - Stub getEnums() in MySQLAdapter and SQLiteAdapter (return []) - Add getEnums() delegation in DBManager - Add diffEnums() in DBSchema, wired before views/tables - Update DiffSorter: enum drops before view drops, creates before view creates - Add EnumSQLTest (7 tests) and DiffSorter enum ordering tests (3 tests) - Update README and copilot-instructions
docs/ is gitignored — remove the only tracked file under docs/.
- Postgres E2E programmable_objects fixture: add order_status (CreateEnum), old_status (DropEnum), priority (AlterEnum) enum types to db1/db2-pgsql.sql - AbstractComprehensiveTest: assert enum diffs in testProgrammableObjectsDiff for pgsql driver (CREATE TYPE, DROP TYPE IF EXISTS, ALTER presence) - Record updated baseline: tests/expected/programmable_objects_pgsql_16.txt now includes enum SQL in correct sort order (drops before views, creates before views) - PostgresDialectTest (new, 10 tests): quote escaping, getDriver, isMySQLOnly, DROP TRIGGER ... ON table syntax, dropIndex, addColumn, dropColumn - SQLiteDialectTest (new, 8 tests): quote escaping, getDriver, isMySQLOnly, DROP TRIGGER (no ON clause), dropIndex, addColumn, dropColumn - EnumSQLTest: 4 new edge-case tests — single-value enum, escaped quotes, AlterEnum drop-before-create ordering, DropEnum/CreateEnum inverse symmetry - DiffSorterProgrammableTest: 4 new sort-order tests — DropEnum before AddTable, CreateEnum after AddTable before CreateView, full 7-item lifecycle
Re-recorded programmable_objects expected output for Postgres 14, 15, 17, and 18 after adding enum fixtures. Only pgsql_16 was re-recorded in the previous commit.
|
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.


