#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    id_kas character(2) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    cenhladina integer DEFAULT (0)::integer,
    ecr_typ character(30) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    comrychl character(5) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    ecr_plu integer DEFAULT (0)::integer,
    ecr_cislo integer DEFAULT (0)::integer,
    comport character(4) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    combit integer DEFAULT (0)::integer,
    comstop integer DEFAULT (0)::integer,
    comlimit integer DEFAULT (0)::integer,
    comparita integer DEFAULT (0)::integer,
    comopakov integer DEFAULT (0)::integer,
    lanip character(15) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    lanport integer DEFAULT (0)::integer,
    lanlimit integer DEFAULT (0)::integer,
    lanopakov integer DEFAULT (0)::integer,
    ecr_fiskal integer DEFAULT (0)::integer,
    ecr_krajin integer DEFAULT (0)::integer,
    ecr_meno character(10) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    ecr_txtcis integer DEFAULT (0)::integer,
    prenosnenu integer DEFAULT (0)::integer,
    index_pol integer DEFAULT (0)::integer,
    zap_rec integer DEFAULT (0)::integer,
    zap_log integer DEFAULT (0)::integer,
    mazat_log integer DEFAULT (0)::integer,
    auto_spust integer DEFAULT (0)::integer,
    zavriet integer DEFAULT (0)::integer,
    uzav_blok integer DEFAULT (0)::integer,
    uzav_zur integer DEFAULT (0)::integer,
    info_zur integer DEFAULT (0)::integer,
    test integer DEFAULT (0)::integer,
    paket integer DEFAULT (0)::integer,
    chyby integer DEFAULT (0)::integer,
    mazat_ecr integer DEFAULT (0)::integer,
    protokol integer DEFAULT (0)::integer,
    heslo character(10) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    modemtelef character(30) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    modeminit character(100) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    modemcakat integer DEFAULT (0)::integer,
    modemzloz integer DEFAULT (0)::integer,
    typport integer DEFAULT (0)::integer,
    modem integer DEFAULT (0)::integer,
    idriadok serial,
    CONSTRAINT euro_idriadok PRIMARY KEY (idriadok)

#[ CREATE TABLE KONEC ]#


#[ IF EXIST ZACATEK ]#
	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='<SCHEMA>' and table_name='euro' and column_name='idriadok') THEN
		ALTER TABLE <SCHEMA>.euro ADD COLUMN idriadok serial;
	END IF;

#[ PRIMARYKEY ]#
END IF;
#[ KONEC SOUBORU ]#