#[ ZACATEK SOUBORU ]#

#DEF <SCHEMA>    food600
#DEF <PRIMARYKEY> idriadok
#DEF <TABLENAME> prikazy_prepocet

#[ CREATE TABLE ZACATEK ]#
    prikaz character varying(1000) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    idriadok SERIAL,
    riadok integer NOT NULL DEFAULT 0,
    podmienka character varying(500) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    CONSTRAINT prikazy_prepocet_idriadok PRIMARY KEY (idriadok)

#[ CREATE TABLE KONEC ]#

#[ IF EXIST ZACATEK ]#
#[ PRIMARYKEY ]#

	IF NOT EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='<SCHEMA>' and table_name='prikazy_prepocet' and column_name='podmienka') THEN
		ALTER TABLE <SCHEMA>.prikazy_prepocet ADD COLUMN   podmienka character varying(500)  NOT NULL DEFAULT ''::character varying;
		ALTER TABLE <SCHEMA>.prikazy_prepocet  ADD CONSTRAINT prikazy_prepocet_idriadok PRIMARY KEY (idriadok);
	END IF;

END IF;

#[ KONEC SOUBORU ]#