You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1][bug] COLUMN_TYPES is incomplete — BIT, JSON, YEAR, BOOL, SERIAL, GEOMETRY fall back to VARCHAR on round-trip #382
Table Designer column type dropdown and round-trip parser.
Problem
src/components/designer/TableDesigner.tsx:23-52 (COLUMN_TYPES) does not include BIT, JSON, YEAR, BOOL, BOOLEAN, SERIAL, GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION. extractBaseType (TableDesigner.tsx:920-940) falls back to VARCHAR for unknown types. A BIT(8) column loaded into the designer shows as VARCHAR; on save, it's re-emitted as VARCHAR(...) — silent data-type change. Same for JSON columns becoming VARCHAR(255), which then fails on INSERT of a JSON literal.
SHOW COLUMNS FROM t shows varchar(255) for j and b — data type lost
Expected
Round-trip preserves all column types.
Proposed fix
Add the missing types to COLUMN_TYPES: ["BIT", "BOOL", "BOOLEAN", "YEAR", "SERIAL", "JSON", "GEOMETRY", "POINT", "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION"]. Update TYPES_WITH_LENGTH in ddl-generator.ts:21-36 to include BIT, YEAR (which accepts (2|4)), JSON. Test the round-trip. Scope: S.
Acceptance
A BIT(8) NOT NULL column round-trips: load → save → SHOW COLUMNS shows bit(8). A JSON column round-trips. A POINT NOT NULL column round-trips.
Activity
fix(designer): keep column modifiers through an edit instead of dropp…
fix(designer): stop the form building DDL the server will not take (#550