#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    idriadok SERIAL,
    rkasa integer NOT NULL DEFAULT 0,
    midserver integer NOT NULL DEFAULT 0,
    rshift integer NOT NULL DEFAULT 0,
    checknum integer NOT NULL DEFAULT 0,
    visit integer NOT NULL DEFAULT 0,
    is_deleted integer NOT NULL DEFAULT 0,
    ivoid integer NOT NULL DEFAULT 0,
    u_cas character(8) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    cena_celk numeric(10,2) NOT NULL DEFAULT 0,
    cena_slev numeric(10,2) NOT NULL DEFAULT 0,
    dph_celk numeric(10,2) NOT NULL DEFAULT 0,
    datcas timestamp without time zone,
    disc_sifr integer NOT NULL DEFAULT 0,
    CONSTRAINT rkeeper_fin_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='rkeeper_fin' and column_name='disc_sifr') THEN
		ALTER TABLE <SCHEMA>.rkeeper_fin ADD COLUMN disc_sifr integer NOT NULL DEFAULT 0;
	END IF;

END IF;

#[ KONEC SOUBORU ]#