#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    idriadok SERIAL,
    shiftnum integer NOT NULL DEFAULT 0,
    rk_sifr integer NOT NULL DEFAULT 0,
    c_uzaverka integer NOT NULL DEFAULT 0,
    suma numeric(12,2) NOT NULL DEFAULT 0,
    datcas timestamp without time zone,
    midserver integer NOT NULL DEFAULT 0,
    c_polot integer NOT NULL DEFAULT 0,
    rk_rep text COLLATE pg_catalog."default",
    CONSTRAINT rkeeper_uzaverka_<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='rkeeper_uzavierky' and column_name='rk_rep') THEN
		ALTER TABLE <SCHEMA>.rkeeper_uzavierky  ADD COLUMN rk_rep text COLLATE pg_catalog."default";
	END IF;

END IF;

#[ KONEC SOUBORU ]#