[BUG] Foreign keys between tables in separate schemas fail

Aperta
#206 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go, postgres
Ambito
databases

Direzione di ricerca

Riproduci il piano CLI DSN-to-DSN con tabelle di chiavi esterne in schemi separati, includendo entrambi gli schemi nel diff. Traccia la generazione SQL delle chiavi esterne del piano; il lavoro è completato quando reftable è qualificata con lo schema e l’SQL generato viene eseguito correttamente sul database di destinazione.

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

Descrizione

bug
Describe the bug**

Plan generation for foreign keys between tables in separate schemas fails. The produced plan does not schema-qualify the reftable, and the statement fails with a table not found error. Several of these errors turned up the output of a single plan run.

Expected behavior**

Produce SQL that schema-qualifies the reftable of a foreign key, (at least if it lies in a separate schema?).

To Reproduce

Start with a DB that contains a table with a foreign key reftable in a separate schema than the table itself. Generate a plan against another DB lacking that foreign key. Note that the plan does not schema-qualify the reftable.
Execute the SQL from the plan and note that it fails with an error about a missing table.

Context

This was with pg-schema-diff v0.9.0, running from the CLI against Amazon Aurora PG15, and the plan output was redirected to a file and later executed.
Plan validation was off, and the diffing was DSN to DSN. A subset of individual schemas was included, with both relevant schemas named for inclusion in the diff.

Lingua principale
Go
Stelle
896
Fork
85
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

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 stripe/pg-schema-diff

Tutte le issue di stripe/pg-schema-diff

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.