-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
The Origin enum in the Source model is implemented as a native enum in PostgreSQL but as simple strings in SQLite:
offseason-proteines-resilientes/src/models/source.py
Lines 26 to 42 in 628b863
| @unique | |
| class Origin(StrEnum): | |
| """ | |
| The origin is used to filter the | |
| """ | |
| AUCHAN = "Auchan" | |
| BIOCOOP = "Biocoop" | |
| CARREFOUR = "Carrefour" | |
| CASINO = "Casino" | |
| ELECLERC = "E.Leclerc" | |
| LA_VIE_CLAIRE = "La Vie Claire" | |
| INTERMARCHE = "Intermarché" | |
| LIDL = "Lidl" | |
| OPEN_FOOD_FACTS = "OpenFoodFacts" | |
| PICARD = "Picard" | |
| SUPER_U = "Super U" |
As a result, when adding a new item to the Origin enum in Python, it causes a conflict with PostgreSQL's own enum for which the new item's value is unknown:
psycopg2.errors.InvalidTextRepresentation: invalid input value for enum origin: "SUPER_U"
PostgreSQL's native enum needs to be updated via a migration script to include Super U as origin value.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
databaseRelated to the database.Related to the database.