CREATE TABLE rpc_conexao_catalogo ( cliente_sac integer NOT NULL, host character varying(100) NOT NULL, database character varying(50) NOT NULL, usuario character varying(50) NOT NULL, senha character varying(100) NOT NULL, porta integer NOT NULL, CONSTRAINT pk_rpc_conexao_catalogo PRIMARY KEY (cliente_sac) ) TABLESPACE pg_default; ALTER TABLE public.rpc_conexao_catalogo OWNER to postgres; CREATE TABLE mkt_catalogo ( sequencia integer NOT NULL, filial integer NOT NULL, titulo character varying(50) NOT NULL, descricao character varying NOT NULL, data_inicial date NOT NULL, data_final date NOT NULL, situacao character varying(1) NOT NULL, id character varying(100) NOT NULL, exibe_estoque character varying(1) NOT NULL, cor_fundo_cabecalho character varying(7) NOT NULL, cor_fundo_pagina character varying(7) NOT NULL, cor_fundo_card character varying(7) NOT NULL, cor_fonte_cabecalho character varying(7) NOT NULL, cor_fonte_card character varying(7) NOT NULL, logo oid, CONSTRAINT pk_mkt_catalogo PRIMARY KEY (sequencia) ) TABLESPACE pg_default; ALTER TABLE public.mkt_catalogo OWNER to postgres; CREATE TABLE mkt_catalogo_item ( catalogo integer NOT NULL, filial_produto integer NOT NULL, produto integer NOT NULL, filial_almoxarifado integer NOT NULL, almoxarifado integer NOT NULL, CONSTRAINT pk_mkt_catalogo_item PRIMARY KEY (catalogo, filial_produto, produto), CONSTRAINT fk_mkt_catalogo_item_catalogo FOREIGN KEY (catalogo) REFERENCES mkt_catalogo (sequencia) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT fk_mkt_catalogo_item_produto FOREIGN KEY (filial_produto, produto) REFERENCES pro_produto (filial_pro, codigo) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT fk_mkt_catalogo_item_almoxarifado FOREIGN KEY (filial_almoxarifado, almoxarifado) REFERENCES bas_almoxarifado (filial, codigo) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ) TABLESPACE pg_default; ALTER TABLE public.mkt_catalogo_item OWNER to postgres; CREATE TABLE mkt_aux_catalogo_item ( terminal_ip character varying(50) NOT NULL, produto integer NOT NULL, descricao character varying(100) NOT NULL, grupo integer NOT NULL, subgrupo integer NOT NULL, aplicacao integer NOT NULL, fornecedor integer NOT NULL, CONSTRAINT pk_mkt_aux_catalogo_item PRIMARY KEY (terminal_ip,produto) ) TABLESPACE pg_default; ALTER TABLE public.mkt_aux_catalogo_item OWNER to postgres;