#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    c_stredisk integer NOT NULL DEFAULT 0,
    c_karty integer NOT NULL DEFAULT (0)::integer,
    zustatek numeric(20,10) NOT NULL DEFAULT (0),
    cena_prum numeric(20,10) NOT NULL DEFAULT (0),
    max_zaso numeric(20,10) NOT NULL DEFAULT (0),
    min_zaso numeric(20,10) NOT NULL DEFAULT (0),
    rezervace numeric(20,10) NOT NULL DEFAULT (0),
    c_mena smallint NOT NULL DEFAULT 1,
    vycisleni character(1) COLLATE pg_catalog."default" NOT NULL DEFAULT '0'::bpchar,
    c_data smallint NOT NULL DEFAULT 1,
    idriadok SERIAL,
    CONSTRAINT skl_buf_ck_cs UNIQUE (c_stredisk, c_karty),
    CONSTRAINT <TABLENAME>_<PRIMARYKEY> PRIMARY KEY (<PRIMARYKEY>)
#[ CREATE TABLE KONEC ]#

#[ IF EXIST ZACATEK ]#
#[ PRIMARYKEY ]#

DROP INDEX IF EXISTS <SCHEMA>.c_karty2_buf;
CREATE INDEX c_karty2_buf
    ON <SCHEMA>.skl_buf USING btree
    (c_karty ASC NULLS LAST)
    TABLESPACE pg_default;

DROP INDEX IF EXISTS <SCHEMA>.karta_stredisko1_buf;
CREATE INDEX karta_stredisko1_buf
    ON <SCHEMA>.skl_buf USING btree
    (c_karty ASC NULLS LAST, c_stredisk ASC NULLS LAST)
    TABLESPACE pg_default;

DROP INDEX IF EXISTS <SCHEMA>.skl_buf_c_data;
CREATE INDEX skl_buf_c_data
    ON <SCHEMA>.skl_buf USING btree
    (c_data ASC NULLS LAST)
    TABLESPACE pg_default;

DROP INDEX IF EXISTS <SCHEMA>.skl_buf_c_stredisk;
CREATE INDEX skl_buf_c_stredisk
    ON <SCHEMA>.skl_buf USING btree
    (c_stredisk ASC NULLS LAST)
    TABLESPACE pg_default;

END IF;

#[ KONEC SOUBORU ]#