Integrity check compares a cast-stripped default against the raw one — every converged migrate exits non-zero

Aperta
#97 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
64/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp, postgresql
Ambito
databases

Direzione di ricerca

Start at the post-apply schema integrity check and its comparison with the default read from pg_attrdef; reproduce the report against a converged database or a migration using an explicit ::text default. Done means both values are normalized consistently, the check passes, and migrate exits 0 when no operations are needed.

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

Descrizione

Version

DataProviderMigrate 0.9.12-beta.

Summary

The post-apply schema integrity check reports a mismatch between a default and
itself, differing only by the ::text cast:

Migration completed successfully
SCHEMA INTEGRITY CHECK FAILED
public.topup.status: default expected 'pending' but found 'pending'::text

The schema declares exactly what the database contains:

- name: status
  type: Text
  isNullable: false
  defaultValue: "'pending'::text"

One side of the comparison is normalised (cast stripped) and the other is not, so
they can never match for any defaultValue written with an explicit cast.

Impact

This is worse than cosmetic, because it destroys the exit code as a signal:

Phase: all — applying 1 of 1 operation(s):
  AddCheckConstraintOperation
Migration completed successfully
SCHEMA INTEGRITY CHECK FAILED
make: *** [migrate] Error 1

The migration applied correctly and the tool still exits non-zero. A fully converged
database does the same:

Schema is up to date — no operations needed
SCHEMA INTEGRITY CHECK FAILED

So an operator cannot distinguish "your migration failed" from "your migration worked
and the checker is comparing a string to itself", and no wrapper can gate on the exit
status. We hit this while diagnosing a real failure (#96) and had to read the log body
to tell the two apart.

Expected

Normalise both sides before comparing — parse the default to a value, or apply the
same cast-stripping to the value read from pg_attrdef that is applied to the schema
value. A converged database should exit 0.

Lingua principale
C#
Stelle
68
Fork
4
Merge medio
50m
PR unite (30g)
2

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.