Skip to content

feat(enum): add PostgreSQL enum type diffing#173

Merged
jasdeepkhalsa merged 4 commits intomasterfrom
feature/enum-type-diffing
Apr 7, 2026
Merged

feat(enum): add PostgreSQL enum type diffing#173
jasdeepkhalsa merged 4 commits intomasterfrom
feature/enum-type-diffing

Conversation

@jasdeepkhalsa
Copy link
Copy Markdown
Member

  • 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/.
@github-actions github-actions bot added enhancement php Pull requests that update php code labels Apr 7, 2026
@jasdeepkhalsa jasdeepkhalsa changed the title Feature/enum type diffing feat(enum): add PostgreSQL enum type diffing Apr 7, 2026
- 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.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

@jasdeepkhalsa jasdeepkhalsa merged commit 5512dbc into master Apr 7, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement php Pull requests that update php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant