#[ ZACATEK SOUBORU ]#

#DEF <SCHEMA>    food600
#DEF <PRIMARYKEY> id_limit
#DEF <TABLENAME> nlimitsablonyhl

#[ CREATE TABLE ZACATEK ]#
    id_limit SERIAL,
    menolimit character(50) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    id_typ integer NOT NULL DEFAULT 0,
    pocetdni integer NOT NULL DEFAULT 1,
    c_data smallint NOT NULL DEFAULT 1,
    id_chod integer NOT NULL DEFAULT 0,
    CONSTRAINT nlimitsablonyhl_id_limit 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='nlimitsablonyhl' and column_name='id_limit_master') THEN
		ALTER TABLE <SCHEMA>.nlimitsablonyhl  ADD COLUMN id_limit_master integer NOT NULL DEFAULT 0;
	END IF;
	IF NOT EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='<SCHEMA>' and table_name='nlimitsablonyhl' and column_name='id_sync') THEN
		ALTER TABLE <SCHEMA>.nlimitsablonyhl  ADD COLUMN id_sync integer NOT NULL DEFAULT 0;
	END IF;
END IF;

#[ KONEC SOUBORU ]#