Found while adding the create-database-table MCP tool (#8633).
The driver default block reads column.default (the SQL string being built) instead of col.default, and has no branch for some types.
Steps to reproduce
- Create a
real (or double precision) column with default: "1.5". Emits DEFAULT NaN (parseFloat(undefined)), so the default is lost.
- Create a
boolean column with default: "true". Emits DEFAULT false every time (undefined === 'true'), regardless of the value.
- Create a
date or bigserial column with a default. The default is silently dropped (no branch).
Expected
The created column default reflects the supplied value.
Reference
forge/ee/lib/tables/drivers/postgres-supavisor.js:374,376 and postgres-localfs.js:301,303 (column.default should be col.default); default block postgres-supavisor.js:368-379 has no date/bigserial case.
Found while adding the create-database-table MCP tool (#8633).
The driver default block reads
column.default(the SQL string being built) instead ofcol.default, and has no branch for some types.Steps to reproduce
real(ordouble precision) column withdefault: "1.5". EmitsDEFAULT NaN(parseFloat(undefined)), so the default is lost.booleancolumn withdefault: "true". EmitsDEFAULT falseevery time (undefined === 'true'), regardless of the value.dateorbigserialcolumn with a default. The default is silently dropped (no branch).Expected
The created column default reflects the supplied value.
Reference
forge/ee/lib/tables/drivers/postgres-supavisor.js:374,376andpostgres-localfs.js:301,303(column.defaultshould becol.default); default blockpostgres-supavisor.js:368-379has nodate/bigserialcase.