#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    uzaverka character(17) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    ciastka numeric(16,4) NOT NULL DEFAULT 0,
    md character varying(8) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    dal character varying(8) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    md2 character varying(7) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    dal2 character varying(7) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    hs_md character varying(15) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    hs_dal character varying(15) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    cena0 numeric(13,2) NOT NULL DEFAULT 0,
    cena5 numeric(13,2) NOT NULL DEFAULT 0,
    dan5 numeric(12,2) NOT NULL DEFAULT 0,
    dan23 numeric(12,2) NOT NULL DEFAULT 0,
    vymaz smallint NOT NULL DEFAULT 0,
    storno smallint NOT NULL DEFAULT 0,
    poznamka character varying(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    pozn_pol character varying(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    idriadok SERIAL,
    cena23 numeric(13,2) NOT NULL DEFAULT 0,
    c_data smallint NOT NULL DEFAULT 1,
    u_cis character(7) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    CONSTRAINT <TABLENAME>_<PRIMARYKEY> PRIMARY KEY (<PRIMARYKEY>)
#[ CREATE TABLE KONEC ]#

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

	IF NOT EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='<SCHEMA>' and table_name='uexarsk' and column_name='u_cis') THEN
		ALTER TABLE <SCHEMA>.uexarsk   ADD COLUMN u_cis character(7) NOT NULL DEFAULT '';
	END IF;

END IF;

#[ KONEC SOUBORU ]#