ai-cfia / ailab-datastore

This is a repo representing the data layer of multiple ailab projects
MIT License
2 stars 0 forks source link

As a Devops, id like fertiscan sql scripts to be actual representation of database we have in prod #167

Closed SonOfLope closed 1 month ago

SonOfLope commented 1 month ago

There's an error with an insert done in schema_0.0.6.sql https://github.com/ai-cfia/ailab-datastore/blob/main/datastore/db/bytebase/FertiScan/schema_0.0.6.sql

we do an insert into sub_label instead of sub_type :

    INSERT INTO "fertiscan_0.0.6".sub_label(type_fr,type_en) VALUES
    ('Instruction','Instruction'),
    ('Mise en garde','Caution'),
    ('Premier soin','First aid'),
    ('Garantie','Warranty');

This resolves in an error in the init_data.sql since the columns we are inserting to dont exist in sub_label table :

    CREATE TABLE "fertiscan_0.0.6"."sub_label" (
        "id" uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
        "text_content_fr" text NOT NULL DEFAULT '',
        "text_content_en" text NOT NULL DEFAULT '',
        "label_id" uuid NOT NULL REFERENCES "fertiscan_0.0.6"."label_information" ("id"),
        "edited" boolean NOT NULL,
        "sub_type_id" uuid NOT NULL REFERENCES "fertiscan_0.0.6"."sub_type" ("id")
    );