#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    c_karty integer NOT NULL DEFAULT (0)::integer,
    c_karty2 integer NOT NULL DEFAULT (0)::integer,
    koef_mnoz numeric(15,10) DEFAULT (0)::numeric,
    koef_ceny numeric(15,10) DEFAULT (0)::numeric,
    flag character(1) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    label character(1) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    bour_skup character(2) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    poradi character(1) COLLATE pg_catalog."default" DEFAULT '0'::bpchar,
    c_data smallint NOT NULL DEFAULT 1,
    idriadok SERIAL,
    zmena timestamp without time zone NOT NULL DEFAULT now(),
    poradie smallint NOT NULL DEFAULT 0,
    CONSTRAINT bourak_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='<TABLENAME>' and column_name='poradie') THEN
		ALTER TABLE <SCHEMA>.bourak ADD COLUMN poradie smallint NOT NULL DEFAULT 0;
	END IF;

END IF;


#[ KONEC SOUBORU ]#