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] AutoIncrement checkbox enabled on all column types — designer emits VARCHAR AUTO_INCREMENT, fails on save #383
Table Designer column-level checkbox for auto_increment.
Problem
src/components/designer/TableDesigner.tsx:200-205 — the autoIncrement checkbox is enabled for every column regardless of type. buildColumnDef (ddl-generator.ts:55-58) appends AUTO_INCREMENT if the flag is set. MySQL rejects VARCHAR(255) AUTO_INCREMENT with ERROR 1063 (42000): Incorrect column specifier for column 'x'. AUTO_INCREMENT requires an integer type (INT, BIGINT, TINYINT, SMALLINT, MEDIUMINT) and an index/key on the column. The error surfaces at Save time only.
VARCHAR column's AUTO_INCREMENT checkbox is disabled with a tooltip "Auto-increment requires an integer type and an index". An INT column's checkbox is enabled.
Proposed fix
Disable the autoIncrement checkbox unless TYPES_WITH_LENGTH.has(col.type) AND the type starts with INT|BIGINT|TINYINT|SMALLINT|MEDIUMINT. Show a tooltip explaining the restriction when disabled. Scope: S.
Acceptance
A VARCHAR column's AUTO_INCREMENT checkbox is disabled with the tooltip. An INT column's checkbox is enabled. Saving a VARCHAR with autoIncrement=true (forced via setState in test) returns the MySQL error message clearly.
Already fixed — closing with the check rather than a change.
The AUTO_INCREMENT checkbox is disabled unless the column's type can carry one (canAutoIncrement), with a tooltip saying why, and buildColumnDef will not emit it for such a type even if the flag is set — so a config loaded from elsewhere cannot produce VARCHAR(255) AUTO_INCREMENT either. That is ERROR 1063, and it used to be visible only at save time. Test: "will not let a VARCHAR be marked auto-increment".
Activity
fix(designer): stop the form building DDL the server will not take (#550
EVWorth commentedon Sep 12, 2026
Already fixed — closing with the check rather than a change.
The AUTO_INCREMENT checkbox is disabled unless the column's type can carry one (
canAutoIncrement), with a tooltip saying why, andbuildColumnDefwill not emit it for such a type even if the flag is set — so a config loaded from elsewhere cannot produceVARCHAR(255) AUTO_INCREMENTeither. That is ERROR 1063, and it used to be visible only at save time. Test: "will not let a VARCHAR be marked auto-increment".