#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    idriadok SERIAL,
    oldextid character(50) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    name character(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    typ_baz character(10) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    c_data smallint NOT NULL DEFAULT 1,
    zmaz smallint NOT NULL DEFAULT 0,
    CONSTRAINT baz_pristupy_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='baz_pristupy' and column_name='zmaz') THEN
		ALTER TABLE <SCHEMA>.baz_pristupy  ADD COLUMN zmaz smallint NOT NULL DEFAULT 0;
	END IF;
END IF;


#[ KONEC SOUBORU ]#