#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    c_stredisk integer,
    operace character(2) COLLATE pg_catalog."default",
    c_dokl integer,
    c_karty integer NOT NULL DEFAULT 0,
    mnozstvi numeric(20,10),
    cena numeric(20,10),
    cena_part numeric(20,10),
    zustatek numeric(20,10),
    cena_prum numeric(20,10),
    dan numeric(5,3) DEFAULT 1,
    serial_no character(20) COLLATE pg_catalog."default",
    poradi integer,
    c_oprava integer NOT NULL,
    kdy timestamp without time zone,
    c_data smallint NOT NULL DEFAULT 1,
    idriadok SERIAL,
    CONSTRAINT <TABLENAME>_<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='obra_sto' and column_name='sscc') THEN
		ALTER TABLE <SCHEMA>.obra_sto ADD COLUMN sscc character varying;
	END IF;

END IF;

#[ KONEC SOUBORU ]#