durcno@1.0.0-alpha.26
Patch Changes
-
d8fd84c - Thanks to @almahdi404 !
fix(migrations): use backticks instead of quotes on column types
Fixes generated migration statements for
addColumnandalterColumnTypeto wrap column types in template literal backticks instead of double quotes.This prevents syntax errors in generated migrations when column types contain double quotes, such as qualified enum types (e.g.,
"public"."role"), aligning them withcreateTablecolumn definitions. -
7eb8f4e - Thanks to @almahdi404 !
fix(cli/generate): correct column and index statement ordering in migrations
The
generatecommand produced migrations with incorrect DDL ordering, causing PostgreSQL errors when columns and indexes changed together on the same table.Two issues were fixed in
generateAlterTableStmts:- Missing
dropIndex: removed indexes were never emitted asddl.dropIndex(), so dropping a column that had an index would fail. createIndexbeforeaddColumn: new index statements were emitted before thealterTableblock containingaddColumn, so indexing a newly added column would fail.
The corrected order is now:
dropIndex→alterTable→createIndex. - Missing