Skip to content

fix(structure): keep auto increment on the Postgres family beside the generated fields - #2562

Merged
datlechin merged 1 commit into
mainfrom
fix/postgres-auto-increment-structure-field
Aug 27, 2026
Merged

fix(structure): keep auto increment on the Postgres family beside the generated fields#2562
datlechin merged 1 commit into
mainfrom
fix/postgres-auto-increment-structure-field

Conversation

@datlechin

Copy link
Copy Markdown
Member

Adding generated-column support in #2557 replaced .autoIncrement in the Postgres family's
structureColumnFields rather than joining it. MySQL, MariaDB and SQLite gained the two new fields
and kept auto increment; PostgreSQL, CockroachDB and PGlite gained them and lost it.

MySQL        .name .type .nullable .defaultValue .generated .generationExpression .onUpdate .autoIncrement .comment …
SQLite       .name .type .nullable .defaultValue .generated .generationExpression .autoIncrement .comment
PostgreSQL   .name .type .nullable .defaultValue .generated .generationExpression .comment      ← lost it
CockroachDB  .name .type .nullable .defaultValue .generated .generationExpression .comment      ← lost it
PGlite       .name .type .nullable .defaultValue .generated .generationExpression .comment      ← lost it
Redshift     .name .type .nullable .defaultValue .autoIncrement .comment                        ← never had them

PostgreSQLPluginDriver.swift:1081 still reads col.autoIncrement and still generates the DDL for
it, so this removed the control rather than the capability: a SERIAL column had no Auto Increment
flag in the structure editor while the driver went on writing one.

The two spellings both had to move. PostgreSQLPlugin.structureColumnFields is what wins once the
plugin loads, and the curated entries are what answer before it does and what registerVariant
keeps permanently for CockroachDB and PGlite.

How CI reported it

This is the whole of the Unit tests job failure on main. StructureRowProviderBooleanOptionsTests
walks every boolean field and records an issue for one the columns tab cannot order, and
.autoIncrement was the one:

✘ "Every boolean column supplies its own YES/NO options" 1 issue(s)
✘ Suite "StructureRowProvider boolean options" failed

The guard

autoIncrementSurvivesTheGeneratedFields asserts the four Postgres-family engines offer the field,
with Redshift in the list as a control that never gained the generated pair and never lost this one.
declaredBooleanFieldsResolve covers the shape of the defect rather than this instance: the columns
tab looks each boolean field up in the ordered list and skips a miss, so an engine that stops
declaring one loses its editor silently instead of failing.

Negative-tested: with the fix reverted the guard fails on PostgreSQL, CockroachDB and PGlite and
passes on Redshift.

No CHANGELOG entry

#2557 is unreleased, so this never reached a user. CLAUDE.md: do not add a Fixed entry for
something that is itself still unreleased.

What this does not fix

main is also red on all three UI tests shards, and that is unrelated to this change. Four
EditorTabReorderUITests cases have failed every run since #2472 added them on Aug 26, and a
rotating pair of cases fails with "The sample database never finished opening". All four reorder
cases pass locally, including with the window pinned to the runner's 1024x768 geometry; the one
local failure I could produce came from a loaded machine and took 125s against 25s for a passing
run. Being chased separately.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@datlechin
datlechin merged commit 3c72947 into main Aug 27, 2026
8 checks passed
@datlechin
datlechin deleted the fix/postgres-auto-increment-structure-field branch August 27, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant