AddColumn with inline checkConstraint on an existing table double-applies the constraint (42710)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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 AddColumnOperationemits the bare column and leaves the check toAddCheckConstraintOperation.
Environment
- Postgres 17 (Supabase)
- Provider: postgres
- Consumer: Nimblesite/NimblesiteAgenticPlatform
migrations/schema.yaml, tableagent_configs
- Lenguaje dominante
- C#
- Estrellas
- 68
- Forks
- 4
- Merge medio
- 36 min
- PR fusionados (30 d)
- 9
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Nimblesite/DataProvider
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Nimblesite/DataProvider#72 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Nimblesite/DataProvider#121 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Nimblesite/DataProvider#108 ·
Los mantenedores suelen responder en 1 día
-
A check constraint the schema cannot name can never be retired, and keeps enforcing the old ruleAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Nimblesite/DataProvider#107 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Nimblesite/DataProvider#106 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Nimblesite/DataProvider
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
enhancement no-stack-trace
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
greenshot/greenshot#1618 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
squad/utforming status/triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Altinn/altinn-studio#21565 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Tyrrrz/YoutubeDownloader#912 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día