#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    mena character(3) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    kurs numeric(20,10) NOT NULL DEFAULT (0),
    stat character(12) COLLATE pg_catalog."default" DEFAULT ''::bpchar,
    pocet numeric(20,10) NOT NULL DEFAULT (0),
    hladiny character(130) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    kurs_nak numeric(20,10) NOT NULL DEFAULT (0),
    zaok_men numeric(20,10) NOT NULL DEFAULT (0),
    idriadok SERIAL,
    CONSTRAINT kursy_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='kursy' and column_name='id_kas') THEN
		ALTER TABLE <SCHEMA>.kursy ADD COLUMN id_kas character(2) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::bpchar;
	END IF;
END IF;

#[ KONEC SOUBORU ]#