#[ ZACATEK SOUBORU ]#

#DEF <SCHEMA>    food600
#DEF <PRIMARYKEY> id_sprava
#DEF <TABLENAME> spravy

#[ CREATE TABLE ZACATEK ]#
    id_sprava SERIAL,
    sprava character varying(40) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::character varying,
    c_data smallint NOT NULL DEFAULT 1,
    CONSTRAINT spravy_<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='spravy' and column_name='id_sprava_master') THEN
		ALTER TABLE <SCHEMA>.spravy  ADD COLUMN id_sprava_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='spravy' and column_name='id_sync') THEN
		ALTER TABLE <SCHEMA>.spravy  ADD COLUMN id_sync integer NOT NULL DEFAULT 0;
	END IF;
END IF;

#[ KONEC SOUBORU ]#