Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #165: Adds init data script for fertiscan #166

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions datastore/db/bytebase/FertiScan/init_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM "fertiscan_0.0.6".sub_label WHERE type_fr = 'Instruction' AND type_en = 'Instruction') THEN
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');
END IF;

IF NOT EXISTS (SELECT 1 FROM "fertiscan_0.0.7".sub_type WHERE type_fr = 'Instruction' AND type_en = 'Instruction') THEN
INSERT INTO "fertiscan_0.0.7".sub_type(type_fr,type_en) VALUES
('Instruction','Instruction'),
('Mise en garde','Caution'),
('Premier soin','First aid'),
('Garantie','Warranty');
END IF;

IF NOT EXISTS (SELECT 1 FROM "fertiscan_0.0.9".sub_type WHERE type_fr = 'Instruction' AND type_en = 'Instruction') THEN
INSERT INTO "fertiscan_0.0.9".sub_type(type_fr,type_en) VALUES
('Instruction','Instruction'),
('Mise en garde','Caution'),
('Premier soin','First aid'),
('Garantie','Warranty');
END IF;

IF NOT EXISTS (SELECT 1 FROM "fertiscan_0.0.10".sub_type WHERE type_fr = 'Instruction' AND type_en = 'Instruction') THEN
INSERT INTO "fertiscan_0.0.10".sub_type(type_fr,type_en) VALUES
('Instruction','Instruction'),
('Mise en garde','Caution'),
('Premier soin','First aid'),
('Garantie','Warranty');
END IF;

IF NOT EXISTS (SELECT 1 FROM "fertiscan_0.0.11".sub_type WHERE type_fr = 'instructions' AND type_en = 'instructions') THEN
INSERT INTO "fertiscan_0.0.11".sub_type(type_fr,type_en) VALUES
('instructions','instructions'),
('mises_en_garde','cautions'),
('premier_soin','first_aid'),
('garanties','warranties');
END IF;

IF NOT EXISTS (SELECT 1 FROM "fertiscan_0.0.12".sub_type WHERE type_fr = 'instructions' AND type_en = 'instructions') THEN
INSERT INTO "fertiscan_0.0.12".sub_type(type_fr,type_en) VALUES
('instructions','instructions'),
('mises_en_garde','cautions'),
('premier_soin','first_aid'),
('garanties','warranties');
END IF;

IF NOT EXISTS (SELECT 1 FROM "fertiscan_0.0.14".sub_type WHERE type_fr = 'instructions' AND type_en = 'instructions') THEN
INSERT INTO "fertiscan_0.0.14".sub_type(type_fr,type_en) VALUES
('instructions','instructions'),
('mises_en_garde','cautions'),
('premier_soin','first_aid'),
('garanties','warranties');
END IF;
END $$;
Loading