47 lines
5.6 KiB
Bash
Executable File
47 lines
5.6 KiB
Bash
Executable File
psql -v ON_ERROR_STOP=1 --username pero --password "pero.000" --dbname komponiranje <<-EOSQL
|
|
|
|
CREATE TABLE machines (id SERIAL PRIMARY KEY, name VARCHAR(100));
|
|
|
|
CREATE TABLE products (
|
|
id SERIAL PRIMARY KEY,
|
|
name VARCHAR(100),
|
|
description TEXT,
|
|
image VARCHAR(100)
|
|
);
|
|
|
|
CREATE TABLE machine_products (
|
|
machine_id integer NOT NULL CONSTRAINT machine_products_machine_id_fk REFERENCES machines,
|
|
product_id integer NOT NULL CONSTRAINT machine_products_product_id_fk REFERENCES products
|
|
);
|
|
|
|
INSERT INTO public.machines (id, name) VALUES (1, 'Fizzy mašina');
|
|
INSERT INTO public.machines (id, name) VALUES (2, 'Kavašina');
|
|
INSERT INTO public.machines (id, name) VALUES (3, 'Mašina sendvičara');
|
|
|
|
INSERT INTO public.products (id, name, description, image) VALUES (1, 'Coca Cola', 'Bacon ipsum dolor amet kevin alcatra beef ribs kielbasa boudin bacon. Spare ribs landjaeger sausage, turducken cow ribeye beef chislic t-bone pastrami short loin pork belly pork loin. Pastrami turducken cupim short ribs flank beef t-bone meatball buffalo bresaola frankfurter jerky leberkas.', 'coca-cola.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (2, 'Pepsi', 'T-bone beef shank turducken picanha, beef ribs strip steak tail swine shankle. Boudin tail pork belly jerky, flank swine chicken shoulder ham ball tip beef pork loin sirloin chislic chuck. Alcatra filet mignon short ribs shankle fatback chuck tongue rump kielbasa doner boudin prosciutto kevin shank. Rump meatball burgdoggen salami cow picanha ball tip, capicola sirloin tri-tip chicken sausage meatloaf frankfurter.', 'pepsi.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (3, 'Fanta', 'Frankfurter t-bone drumstick, beef brisket cupim tri-tip pork belly ham hock pork loin. T-bone meatloaf ham, pork belly ground round turkey tail swine frankfurter.', 'fanta.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (4, 'Cockta', 'Biltong hamburger beef prosciutto, capicola landjaeger chuck. Pig pastrami rump kevin, meatloaf pork chop jowl ground round buffalo t-bone pork turducken meatball capicola.', 'cockta.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (5, 'Kava', 'Kielbasa landjaeger sausage capicola sirloin filet mignon doner t-bone. Swine corned beef turkey hamburger flank pork chop capicola prosciutto venison shoulder strip steak jowl. Tongue pork salami biltong doner chislic andouille ball tip strip steak prosciutto.', 'kava.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (6, 'Kava s mlijekom', 'Shoulder bacon flank chuck jowl hamburger swine fatback shank shankle t-bone buffalo leberkas cow.', 'kava-s-mlijekom.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (7, 'Kava bez šećera', 'Pork pig prosciutto shoulder, landjaeger drumstick andouille filet mignon pork chop tri-tip bresaola tail.', 'kava-bez-secera.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (8, 'Cappuccino', 'Fatback frankfurter jowl capicola. Buffalo short loin pancetta cow ball tip chicken. Pork loin biltong filet mignon rump t-bone kielbasa tail hamburger jowl pancetta andouille short loin.', 'cappucino.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (9, 'Mocca', 'Capicola salami shoulder tri-tip chicken meatball. Tail meatball filet mignon, landjaeger meatloaf sirloin strip steak chicken capicola picanha cow andouille rump shoulder. Chuck buffalo doner short ribs bacon ground round pancetta flank picanha pork loin.', 'mocca.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (10, 'Sendvič sa sirom', 'Ball tip beef ribs shank ground round t-bone, strip steak leberkas chuck beef pancetta burgdoggen biltong doner swine brisket. Pork chop tail cow filet mignon salami spare ribs pork belly boudin. ', 'sendvic-sa-sirom.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (11, 'Sendvič sa šunkom', 'Alcatra meatball filet mignon bresaola landjaeger, ham tenderloin chicken t-bone cow ham hock sausage fatback. Ground round cow ball tip ham venison beef ribs pork loin shank.', 'sendvic-sa-sunkom.jpeg');
|
|
INSERT INTO public.products (id, name, description, image) VALUES (12, 'Vegetarijanski sendvič sa šunkom', 'Venison ham hock pork chop, short loin brisket flank tenderloin salami pork loin bacon short ribs tail bresaola landjaeger ball tip. Beef chicken pork chop sirloin, hamburger cow tri-tip tenderloin tail jowl prosciutto drumstick venison capicola picanha.', 'vegetarijanski-sendvic-sa-sunkom.jpeg');
|
|
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (1, 1);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (1, 2);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (1, 3);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (1, 4);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (2, 5);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (2, 6);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (2, 7);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (2, 8);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (2, 9);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (3, 10);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (3, 11);
|
|
INSERT INTO public.machine_products (machine_id, product_id) VALUES (3, 12);
|
|
EOSQL
|