Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#103 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp, postgresql

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
  • 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
Lenguaje dominante
C#
Estrellas
68
Forks
4
Merge medio
36 min
PR fusionados (30 d)
9

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Nimblesite/DataProvider

Todos los issues de Nimblesite/DataProvider

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.