fix(dictionary): repair add_dictionary_vocabulary against the real schema #70
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
project-halkyon/halkyon-infra!70
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/70/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The deployed
add_dictionary_vocabulary(from202606291840) is written against a schema that does not exist in this database: it referencese.lemma,cards.source_id/normalized_expression/normalized_reading, the tablescard_tagsandcard_review_states, andtags.color. Postgres validates plpgsql bodies only at call time, so the function was created cleanly but throws whenever it is actually called.count_dictionary_entriesonly reads real columns, so it kept working and masked the breakage — meaning the chips show counts but Greek and Japanese bulk-add fail at the point of insert.Fix
Recreate the function from the last schema-correct body (
20260607130000): payload-based vocabulary cards, FSRS inline onpublic.cards, content tags (pos ∪ common ∪ jlpt-n*) found/created inpublic.tagsand joined viapublic.flashcard_tags. The only thing carried over from the divergent version is the part it got right — thehnc_lemma_words_<N>(500…5000) filter params and predicates, which reference the real, populated columns.card_content_from_text/dictionary_tag_colorre-declared idempotently → migration is self-contained.Note
This migration depends on the
hnc_lemma_words_<N>columns (added by202606291355_add_hnc_lemma_words_bulks.sql), which is currently untracked in the repo (applied to the live DB out-of-band). Against the live DB this migration applies cleanly; for a consistent migration tree,202606291355(and the wiktionary column migration) should be committed before this one. Happy to fold that in if wanted.Apply via the Supabase SQL editor (or
supabase db push); it is idempotent for the function definition.