#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    idriadok SERIAL,
    poc_stolu integer NOT NULL DEFAULT 99,
    uzav_prn character(4) COLLATE pg_catalog."default" NOT NULL DEFAULT 'LPT1'::bpchar,
    uzav_no character(2) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    max_ucis numeric(5,0) NOT NULL DEFAULT 0,
    last_dokla numeric(5,0) NOT NULL DEFAULT 0,
    uz_cislo integer NOT NULL DEFAULT 1,
    uz_date date,
    uz_time character(5) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    uz_suma numeric(9,2) NOT NULL DEFAULT 0,
    hor_path character(40) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    sme_path character(40) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    sme_odpoc character(6) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    userplat1 character(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    userplat2 character(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    pokl_hrmc character(3) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    set_dat date,
    set_cas character(5) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    pokl_horec character(5) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    ducis integer NOT NULL DEFAULT 0,
    pokl_front numeric(11,0) NOT NULL DEFAULT 0,
    pokl_gubi numeric(5,0) NOT NULL DEFAULT 0,
    last_vklvy numeric(5,0) NOT NULL DEFAULT 0,
    master_id character(2) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    id_fmenu integer NOT NULL DEFAULT 0,
    CONSTRAINT kasa_set_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='kasa_set' and column_name='id_fmenu') THEN
			ALTER TABLE <SCHEMA>.kasa_set  ADD COLUMN id_fmenu integer NOT NULL DEFAULT 0;
	END IF;
END IF;

#[ KONEC SOUBORU ]#