Skip to content

FF Tables: column default values are broken for real/double and boolean, and ignored for date/bigserial #8635

Description

@andypalmi

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

  1. Create a real (or double precision) column with default: "1.5". Emits DEFAULT NaN (parseFloat(undefined)), so the default is lost.
  2. Create a boolean column with default: "true". Emits DEFAULT false every time (undefined === 'true'), regardless of the value.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageNeeds looking at to decide what to dotype:bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions