#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    c_karty integer NOT NULL DEFAULT (0)::integer,
    ean character(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::bpchar,
    popis character(50) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::bpchar,
    koef numeric DEFAULT 1.0000,
    c_data smallint NOT NULL DEFAULT 1,
    idriadok SERIAL,
    objem numeric(10,4) NOT NULL DEFAULT 1,
    ico character(10) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::bpchar,
    poznamka1 character(10) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::bpchar,
    poznamka2 character(10) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::bpchar,
    cena numeric(10,4) NOT NULL DEFAULT 0,
    skupina character(20) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::bpchar,
    kod character(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    CONSTRAINT <TABLENAME>_<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='sortiment_dodavatelu' and column_name='kod') THEN
		ALTER TABLE <SCHEMA>.sortiment_dodavatelu  ADD COLUMN kod character(30) NOT NULL DEFAULT '';
	END IF;
END IF;

#[ KONEC SOUBORU ]#