#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    c_karty integer NOT NULL DEFAULT (0)::integer,
    c_poloz integer NOT NULL DEFAULT (0)::integer,
    hruba numeric(20,10) DEFAULT (0),
    cista numeric(20,10) DEFAULT (0),
    c_pozn smallint DEFAULT (0)::smallint,
    procento numeric(20,10) DEFAULT (0),
    id_man character(2) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    poznamka character(10) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::bpchar,
    c_data smallint NOT NULL DEFAULT 1,
    idriadok SERIAL,
    poradie integer NOT NULL DEFAULT 0,
    CONSTRAINT polozky_<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='polozky' and column_name='poradie') THEN
		ALTER TABLE <SCHEMA>.polozky  ADD COLUMN poradie integer NOT NULL DEFAULT 0;
	END IF;

END IF;

#[ KONEC SOUBORU ]#