pg-altergen
JSON →A Node.js CLI tool for managing PostgreSQL schema changes by organizing database objects in SQL files and generating ordered migration scripts with automatic dependency resolution. Version 3.4.0. The tool automatically detects schemas, tables, views, functions, and procedures from source directories, resolves dependencies among them, and compiles an ordered alter.sql script. It can drop existing objects before recreating them, ensuring the target database matches definitions. Supports custom directory structures and multiple source directories. CLI-focused, designed for deterministic migrations with a binary search fallback for error isolation. Differentiators: automatic dependency ordering, object drop detection, and customizable config via altergen.json.