---    ALTER TABLE public._zoznam

DO
$$
BEGIN


IF EXISTS (SELECT table_name FROM information_schema.tables WHERE table_schema='public' and table_name='_zoznam') THEN 

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='var_typ') THEN
			ALTER TABLE public._zoznam add column  var_typ character(1) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='comment') THEN
			ALTER TABLE public._zoznam add column  comment character(60) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='supervisor') THEN
			ALTER TABLE public._zoznam add column  supervisor smallint NOT NULL DEFAULT 0;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='poradie') THEN
			ALTER TABLE public._zoznam add column   poradie integer NOT NULL DEFAULT 0;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='skupina') THEN
			ALTER TABLE public._zoznam add column   skupina character(10) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='var_valid') THEN
			ALTER TABLE public._zoznam add column   var_valid character(33) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='var_ponuka') THEN
			ALTER TABLE public._zoznam add column   var_ponuka character(100) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='var_kontr') THEN
			ALTER TABLE public._zoznam add column   var_kontr character(50) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='comment2') THEN
			ALTER TABLE public._zoznam add column   comment2 text NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='j0') THEN
			ALTER TABLE public._zoznam add column   j0 character(50) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='j1') THEN
			ALTER TABLE public._zoznam add column   j1 character(50) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='j2') THEN
			ALTER TABLE public._zoznam add column   j2 character(50) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='j3') THEN
			ALTER TABLE public._zoznam add column   j3 character(50) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='j4') THEN
			ALTER TABLE public._zoznam add column   j4 character(50) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='inp_mask') THEN
			ALTER TABLE public._zoznam add column  inp_mask character(30) NOT NULL DEFAULT ''::bpchar;
	END IF;

	IF not EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='public' and table_name='_zoznam' and column_name='pristup') THEN
			ALTER TABLE public._zoznam add column  pristup numeric(1,0) NOT NULL DEFAULT 0;
	END IF;

END IF;

END
$$
