#[ ZACATEK SOUBORU ]#

#DEF <SCHEMA>    food600
#DEF <PRIMARYKEY> id_typ
#DEF <TABLENAME> nlimittypy

#[ CREATE TABLE ZACATEK ]#
    id_typ SERIAL,
    menotyp character(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    zmazane smallint NOT NULL DEFAULT 0,
    c_data smallint NOT NULL DEFAULT 1,
    hk_typ character(1) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    CONSTRAINT nlimittypy_<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='nlimittypy' and column_name='id_typ_master') THEN
		ALTER TABLE <SCHEMA>.nlimittypy  ADD COLUMN id_typ_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='nlimittypy' and column_name='id_sync') THEN
		ALTER TABLE <SCHEMA>.nlimittypy  ADD COLUMN id_sync integer NOT NULL DEFAULT 0;
	END IF;

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

END IF;


#[ KONEC SOUBORU ]#