Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

AddColumn with inline checkConstraint on an existing table double-applies the constraint (42710)

Aperta
#103 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, postgresql
Ambito
backend, databases

Direzione di ricerca

Read the planner, AddColumnOperation, and AddCheckConstraintOperation, then reproduce the existing-table migration using the declarative schema example in the issue. Done means the new column is applied successfully, its check constraint is present once, and rerunning the migration does not fail with PostgreSQL error 42710.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened

DataProviderMigrate (postgres, additive phase) over a declarative schema where an existing table gains one new column that carries a checkConstraint:

      - name: workspace_size
        type: Text
        checkConstraint: "workspace_size IS NULL OR workspace_size IN ('small','medium','large')"

Plan and outcome:

Phase: all — applying 2 of 2 operation(s):
  AddColumnOperation
  AddCheckConstraintOperation
Error: migration apply failed: 42710: constraint "agent_configs_workspace_size_chk" for relation "agent_configs" already exists

The whole apply rolls back, so the column never lands: information_schema.columns and pg_constraint both show nothing afterwards, and every re-run fails the same way.

Diagnosis

AddColumnOperation already emits the column-level CHECK (named <table>_<column>_chk), and the planner also schedules a separate AddCheckConstraintOperation for the same declaration with the same name. On a fresh CREATE TABLE this does not happen, which is why the same YAML pattern works for columns declared at table-creation time.

Expected

One of:

  • the planner emits only AddColumnOperation (with the inline check) when the column is new, or
  • AddColumnOperation emits the bare column and leaves the check to AddCheckConstraintOperation.

Environment

  • Postgres 17 (Supabase)
  • Provider: postgres
  • Consumer: Nimblesite/NimblesiteAgenticPlatform migrations/schema.yaml, table agent_configs
Lingua principale
C#
Stelle
68
Fork
4
Merge medio
36m
PR unite (30g)
9

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Nimblesite/DataProvider

Tutte le issue di Nimblesite/DataProvider

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.