Skip to content

Add food preference #41

Open

Description

@Poizon7

We want a checkbox list with the most common options as well as a free text field.

The should be a way to separate preferences and allergies.

Activity

  1. changed the title [-]Food preference[/-] [+]Add food preference[/+] on May 13, 2026
  2. added theissue type on May 13, 2026
  3. Alvinn8 commented on Sep 17, 2026

    @Alvinn8

    Here is my suggestion for the database schema:

    create table food_preference
    (
        id      uuid default gen_random_uuid() not null
            primary key,
        name_sv varchar                        not null,
        name_en varchar                        not null
    );
    
    create table allergy
    (
        id                uuid    default gen_random_uuid() not null
            primary key,
        name_sv           varchar                           not null,
        name_en           varchar                           not null,
        parent_allergy_id uuid
            references allergy,
        show_raw          boolean default false             not null,
        show_severe       boolean default false             not null,
        show_airborne     boolean default false             not null
    );
    
    create table user_allergy
    (
        kthid      text not null
            references users
                on delete cascade,
        allergy_id uuid not null
            references allergy,
        raw        boolean,
        severe     boolean,
        airborne   boolean,
        primary key (kthid, allergy_id)
    );
    
    create table user_food_preference
    (
        kthid              text not null
            references users
                on delete cascade,
        food_preference_id uuid not null
            references food_preference,
        primary key (kthid, food_preference_id)
    );

    Together with the following changes to the users table:

    alter table users add food_preference_freetext text;
    
    alter table users add allergy_freetext text;
    
  4. Alvinn8 commented on Sep 24, 2026

    @Alvinn8

    TODO @Alvinn8 add default gen_random_uuid() to UUID uids

    Edit: Added (edited the above message)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions