#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    idriadok SERIAL,
    druh_pl character(8) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    hotel_kod character(3) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    kodcc character(3) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    po_uctoch smallint NOT NULL DEFAULT 0,
    po_timatr smallint NOT NULL DEFAULT 0,
    CONSTRAINT <TABLENAME>_<PRIMARYKEY> 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='hcrc_set' and column_name='po_timatr') THEN
		ALTER TABLE <SCHEMA>.hcrc_set   ADD COLUMN po_timatr smallint NOT NULL DEFAULT 0;
	END IF;

END IF;

#[ KONEC SOUBORU ]#