#[ ZACATEK SOUBORU ]#

#DEF <SCHEMA>    food600
#DEF <PRIMARYKEY> id_strav
#DEF <TABLENAME> nlimitstravnici

#[ CREATE TABLE ZACATEK ]#
    id_strav SERIAL,
    priezvisko character(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    meno character(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    oscislo character(20) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    stredisko character(30) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    zmazane smallint NOT NULL DEFAULT 0,
    c_data smallint NOT NULL DEFAULT 1,
    CONSTRAINT nlimitstravnici_<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='nlimitstravnici' and column_name='id_strav_master') THEN
		ALTER TABLE <SCHEMA>.nlimitstravnici  ADD COLUMN id_strav_master integer NOT NULL DEFAULT 0;
	END IF;

	IF NOT EXISTS (SELECT column_name FROM information_schema.columns WHERE table_schema='<SCHEMA>' and table_name='nlimitstravnici' and column_name='id_sync') THEN
		ALTER TABLE <SCHEMA>.nlimitstravnici  ADD COLUMN id_sync integer NOT NULL DEFAULT 0;
	END IF;

END IF;

#[ KONEC SOUBORU ]#