Migrations that add new field to NpgsqlTsVector SearchVector

Aperta
#3,800 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp, postgresql
Ambito
database

Direzione di ricerca

Start by reproducing the two migration scenarios described: adding an NpgsqlTsVector property alongside new fields, and changing an existing vector to include a new field. Inspect the generated migrations and the errors when applying them; the payload names no specific files or tests. Done means establishing whether a supported migration path exists for both cases and documenting or fixing it.

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

Descrizione

Greetings! I was experimenting with NpgsqlTsVector and searching, and actually found it to be pretty straight forward. I did encounter two problems, and I'm not sure how I should actually handle it.

  1. If I had a pre-existing entity, and I added say the SearchVector property of NpgsqlTsVector type, and I also added fields to be included in that migration, it seemed like the order with which it tried to apply the migrations was backwards... like the setup of the fields to be included in the TsVector, should be last. It was trying to reference columns that were a part of the same migration, but had yet to be created when trying to apply changes related to the creation of that vector and triggers (if that's how that vector gets populated). (I believe I was able to manually open the migration cs, and re-arrange things and then the migration would run.)

  2. If I have an entity with a predefined vector, and I added a field, and then wanted to update the vector to also reference this field, it seems like the migration is created no problem, but when trying to apply the migration I get an error:

42P17: generation expression is not immutable

I think I understand what that is saying, and I think I understand why, but is there a migration path there even if I have to handle that migration more manually?

Lingua principale
C#
Stelle
1.8k
Fork
268
Merge medio
2h 35m
PR unite (30g)
136

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 npgsql/efcore.pg

Tutte le issue di npgsql/efcore.pg

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.