
#[ ZACATEK SOUBORU ]#

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

#[ CREATE TABLE ZACATEK ]#
    idriadok SERIAL,
    id_kas character(2) COLLATE pg_catalog."default" NOT NULL DEFAULT ''::bpchar,
    c_obal integer NOT NULL DEFAULT 0,
    sosebou smallint NOT NULL DEFAULT 0,
    poradie smallint NOT NULL DEFAULT 0,
    c_karty integer NOT NULL DEFAULT 0,
    idriadok_master integer NOT NULL DEFAULT 0,
    id_sync integer NOT NULL DEFAULT 0,
    CONSTRAINT obaly_kasa_karta_c_obal FOREIGN KEY (c_obal)
        REFERENCES <SCHEMA>.obaly (idriadok) MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE CASCADE,
    CONSTRAINT <TABLENAME>_<PRIMARYKEY> PRIMARY KEY (<PRIMARYKEY>)
#[ CREATE TABLE KONEC ]#

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

DROP INDEX IF EXISTS <SCHEMA>.fki_obaly_kasa_karta_c_obal;
CREATE INDEX                fki_obaly_kasa_karta_c_obal
    ON <SCHEMA>.obaly_kasa_karta USING btree
    (c_obal ASC NULLS LAST)
    TABLESPACE pg_default;

END IF;
#[ KONEC SOUBORU ]#