-- Table: atualizanotas -- DROP TABLE atualizanotas; CREATE TABLE atualizanotas ( idnota character varying(50) NOT NULL, CONSTRAINT atualizanotas_pk PRIMARY KEY (idnota) ) WITH ( OIDS=FALSE ); ALTER TABLE atualizanotas OWNER TO postgres; -- Table: carta_correcao -- DROP TABLE carta_correcao; CREATE TABLE carta_correcao ( seq serial NOT NULL, idnota character varying(50) NOT NULL, data_envio timestamp without time zone, xmlassinado text, cstat integer, xmotivo text, idevento character varying(60) NOT NULL, cstat_cc integer, xmotivo_cc text, xmlretorno text, data_email timestamp without time zone, data_impressao timestamp without time zone, CONSTRAINT carta_correcao_pk PRIMARY KEY (seq) ) WITH ( OIDS=FALSE ); ALTER TABLE carta_correcao OWNER TO postgres; -- Table: cnpj -- DROP TABLE cnpj; CREATE TABLE cnpj ( cnpj character varying(20), razao character varying(200), codigocertificado character varying(50), senhacertificado character varying(50), ambiente character varying(2), uf character varying(2), usaimpressao character varying(10), impressora character varying(500), numcopia character varying(2), codigocertificadonfs character varying(50), senhacertificadonfs character varying(50), ambientenfs character varying(2), ufnfs character varying(2), pathlogo character varying(500), enviapdf character varying(10), envianotas character varying(10), informacoesadicionaisobsrodape character varying(2000), emailavisomanifestacaonota character varying(500), imprimedadoscupomrodape character varying(10) ) WITH ( OIDS=FALSE ); ALTER TABLE cnpj OWNER TO postgres; -- Table: cnpjnsu -- DROP TABLE cnpjnsu; CREATE TABLE cnpjnsu ( cnpj character varying(20), tpamb integer, veraplic character varying(5), cstat integer, xmotivo character varying(300), dhresp character varying(50), indcont integer, ultnsu character varying(50) ) WITH ( OIDS=FALSE ); ALTER TABLE cnpjnsu OWNER TO postgres; -- Table: confs -- DROP TABLE confs; CREATE TABLE confs ( dirinput character varying(500), versao character varying(10), portabanco character varying(10), servidor character varying(100), banco character varying(100), usuario character varying(100), senha character varying(100), removearqtemps character varying(10), dirapp character varying(500), dioutputsoluma character varying(500), usaproxy character varying(10), endproxy character varying(500), userproxy character varying(100), senhaproxy character varying(100), portaproxy character varying(10), diroutputnfeentrada character varying(500), popentrada character varying(500), smtpentrada character varying(500), userentrada character varying(100), passentrada character varying(100), tempochecamail character varying(10), addrentrada character varying(100), checaentrada character varying(10), enviaxmlmail character varying(10), popmonitoramento character varying(500), smtpmonitoramento character varying(500), usermonitoramento character varying(100), passmonitoramento character varying(100), addrmonitoramento character varying(100), processanotasabrasf character varying(10), portapopentrada character varying(10), portasmtpentrada character varying(10), portapopmonitoramento character varying(10), portasmtpmonitoramento character varying(10), sslentrada character varying(10), sslmonitoramento character varying(10), emailredir character varying(500), versaolayoutnota character varying(10), somentecompdf character varying(10), addrerrosmail character varying(100), usacontigencia character varying(10), seriecontigencia character varying(10), envianotacontigencia character varying(10), emailerrosnotaentrada character varying(500), protocolobanco character varying(100), usarepositorionotas character varying(10), dirrepositorionotas character varying(500), bancointegracao character varying(100), utilizabancointegracao character varying(10), manifestacienciaautomatico character varying(10), salvatxtnotamanifestada character varying(10), permitirmaisdeumainstanciadaaplicacao character varying(10), addrstorage character varying(200), usaloginunicoenvioemails VARCHAR(10), minutosenvioemails integer ) WITH ( OIDS=FALSE ); ALTER TABLE confs OWNER TO postgres; -- Table: email_notas -- DROP TABLE email_notas; CREATE TABLE email_notas ( idnota character varying(50) NOT NULL, email character varying(500) NOT NULL, CONSTRAINT email_notas_pk PRIMARY KEY (idnota) ) WITH ( OIDS=FALSE ); ALTER TABLE email_notas OWNER TO postgres; -- Table: impressora_especifica -- DROP TABLE impressora_especifica; CREATE TABLE impressora_especifica ( idnota character varying(50) NOT NULL, impressora character varying(500) NOT NULL, CONSTRAINT impressora_especifica_pk PRIMARY KEY (idnota, impressora) ) WITH ( OIDS=FALSE ); ALTER TABLE impressora_especifica OWNER TO postgres; -- Table: nfs -- DROP TABLE nfs; CREATE TABLE nfs ( idnota character varying(50) NOT NULL, data_envio timestamp without time zone, xmlnota text, cstat character varying(15), xmotivo character varying(500), nrec character varying(50), xmlassinado text, protocolo character varying(50), cpf_cnpj character varying(15), inscricaomunicipal character varying(15), data_retrecibo timestamp without time zone, data_impressao timestamp without time zone, xmlretorno text, CONSTRAINT nfs_pk PRIMARY KEY (idnota) ) WITH ( OIDS=FALSE ); ALTER TABLE nfs OWNER TO postgres; -- Index: index_2 -- DROP INDEX index_2; CREATE INDEX index_2 ON nfs USING btree (data_envio, cstat COLLATE pg_catalog."default", xmotivo COLLATE pg_catalog."default", nrec COLLATE pg_catalog."default", protocolo COLLATE pg_catalog."default", cpf_cnpj COLLATE pg_catalog."default", data_retrecibo, data_impressao); -- Table: nfs_cab_imp -- DROP TABLE nfs_cab_imp; CREATE TABLE nfs_cab_imp ( numero_rps integer NOT NULL, serie integer NOT NULL, tipo integer NOT NULL, chave_acesso character varying(50), data_emissao character varying(30), natureza_operacao integer, optante_simples_nacional integer, incentivador_cultural integer, status integer, regime_especial_tributacao integer, tipo_ambiente_nfs integer, cpfcnpj_prestador character varying(20) NOT NULL, inscricao_prestador character varying(20), razao_prestador character varying(100), fantasia_prestador character varying(100), endereco_prestador character varying(100), numero_prestador character varying(10), complemento_prestador character varying(100), bairro_prestador character varying(100), cidade_prestador character varying(100), uf_prestador character varying(3), cep_prestador character varying(20), email_prestador character varying(100), nome_tomador character varying(100), inscricaoestatudal_tomador character varying(15), cpfcnpj_tomador character varying(20), inscricaomunicipal_tomador character varying(15), endereco_tomador character varying(100), numero_tomador character varying(10), complemento_tomador character varying(100), bairro_tomador character varying(100), cidade_tomador character varying(100), uf_tomador character varying(3), cep_tomador character varying(20), email_tomador character varying(100), razaosocial_intermediario character varying(100), cpfcnpj_intermediario character varying(20), inscricaomunicipal_intermediario character varying(20), codigo_obra integer, art integer, item_lista_servico character varying(10), codigo_cnae character varying(10), codigo_tributacao_municipio character varying(20), discriminacao text, municipio_prestacao_servico integer, valor_servicos double precision, valor_deducoes double precision, valor_pis double precision, valor_cofins double precision, valor_inss double precision, valor_ir double precision, valor_csll double precision, iss_retido double precision, valor_iss double precision, valor_iss_retido double precision, outras_retencoes double precision, base_calculo double precision, aliquota double precision, valor_liquido_nfs double precision, desconto_incondicionado double precision, desconto_condicionado double precision, natureza_operacao_desc text, codigo_verificacao_autenticidade text, data_emissao_rps text, numero_nota integer, outras_informacoes text, iss_retido_desc text, CONSTRAINT nfs_cab_imp_pk PRIMARY KEY (numero_rps, serie, tipo) ) WITH ( OIDS=FALSE ); ALTER TABLE nfs_cab_imp OWNER TO postgres; -- Table: nfs_imp_dados -- DROP TABLE nfs_imp_dados; CREATE TABLE nfs_imp_dados ( cpfcnpj_prestador character varying(20) NOT NULL, logo bytea, razo_social character varying(100), endereco_1 text, endereco_2 character varying(500), inscricao character varying(20), email character varying(100), atividade_municipio character varying(100), CONSTRAINT nfs_imp_dados_pk PRIMARY KEY (cpfcnpj_prestador) ) WITH ( OIDS=FALSE ); ALTER TABLE nfs_imp_dados OWNER TO postgres; -- Table: notas -- DROP TABLE notas; CREATE TABLE notas ( idnota character varying(50) NOT NULL, xmlnota text, nrec character varying(15), data_envio timestamp without time zone, xmotivo text, cstat integer, data_retrecibo timestamp without time zone, data_impressao timestamp without time zone, xmlassinado text, xmlprocret text, data_email timestamp without time zone, xmlcancelamento text, xmlinutilizacao text, data_email_cancelamento date, xmlcancelamentosigned text, xmlinutilizacaosigned text, dhregdpec character varying(30), nregdpec character varying(30), envdpec text, retdpec text, CONSTRAINT notas_pk PRIMARY KEY (idnota) ) WITH ( OIDS=FALSE ); ALTER TABLE notas OWNER TO postgres; -- Index: index_notas -- DROP INDEX index_notas; CREATE INDEX index_notas ON notas USING btree (idnota COLLATE pg_catalog."default", nrec COLLATE pg_catalog."default", data_envio, xmotivo COLLATE pg_catalog."default", data_impressao, data_email); -- Table: reccnpj -- DROP TABLE reccnpj; CREATE TABLE reccnpj ( nrec character varying(15), cnpj character varying(20), idnota character varying(50) ) WITH ( OIDS=FALSE ); ALTER TABLE reccnpj OWNER TO postgres; -- Index: index_1 -- DROP INDEX index_1; CREATE INDEX index_1 ON reccnpj USING btree (nrec COLLATE pg_catalog."default", cnpj COLLATE pg_catalog."default", idnota COLLATE pg_catalog."default"); -- Table: rescanc -- DROP TABLE rescanc; CREATE TABLE rescanc ( cnpj character varying(20), nsu character varying(15), chnfe character varying(44), cpf_cnpj character varying(14), xnome character varying(100), ie character varying(14), demi character varying(20), tpnf character varying(1), vnf double precision, digval character varying(30), dhrecbto character varying(20), csitnfe integer, csitconf integer ) WITH ( OIDS=FALSE ); ALTER TABLE rescanc OWNER TO postgres; -- Table: rescce -- DROP TABLE rescce; CREATE TABLE rescce ( cnpj character varying(20), nsu character varying(15), chnfe character varying(44), dhevento character varying(40), tpevento character varying(6), nseqevento character varying(2), descevento character varying(60), xcorrecao text, tpnf character varying(1), dhrecbto character varying(40) ) WITH ( OIDS=FALSE ); ALTER TABLE rescce OWNER TO postgres; -- Table: resnfe -- DROP TABLE resnfe; CREATE TABLE resnfe ( cnpj character varying(20), nsu character varying(15), chnfe character varying(44), cpf_cnpj character varying(14), xnome character varying(100), ie character varying(14), demi character varying(20), tpnf character varying(1), vnf double precision, digval character varying(30), dhrecbto character varying(20), csitnfe integer, csitconf integer, dataconfirmacao date, datadesconhecimento date, datanaorealizada date, dataciencia date, cstatconfirmacao integer, cstatdesconhecimento integer, cstatnaorealizada integer, cstatciencia integer, xmotivoconfirmacao character varying(255), xmotivodesconhecimento character varying(255), xmotivonaorealizada character varying(255), xmotivociencia character varying(255), dataultimoevento date, csitconfultimoevento integer, cstatultimoevento integer, xmotivoultimoevento character varying(255), csitconfemcurso integer DEFAULT (-1), xmlconfirmacao text, xmldesconhecimento text, xmlnaorealizada text, xmlciencia text, xjust character varying(255), datadownload date, cstatdownload integer, xmotivodownload character varying(255), xmldownload text, procnfedownload text, xmlretdownload text, dataerrodownload date ) WITH ( OIDS=FALSE ); ALTER TABLE resnfe OWNER TO postgres; -- Table: usuarios -- DROP TABLE usuarios; CREATE TABLE usuarios ( usr character varying(100), pwd character varying(100), tipo character varying(10), cnpjs text, nfeacess integer, nfeimp integer, nfecons integer, nfexml integer, nfesave integer, nfemail integer, cceacess integer, cceimp integer, ccexml integer, ccesave integer, ccemail integer, resnfensu integer, resnfeacess integer, resnfedetail integer, resnfemanifesta integer, resnfexml integer, resnfesave integer, emailacess integer, emailclear integer ) WITH ( OIDS=FALSE ); ALTER TABLE usuarios OWNER TO postgres; -- View: view_statusnota -- DROP VIEW view_statusnota; CREATE OR REPLACE VIEW view_statusnota AS SELECT DISTINCT notas.xmotivo FROM notas; ALTER TABLE view_statusnota OWNER TO postgres; CREATE TABLE liberacao ( c1 bytea, c2 bytea, c3 bytea, ex character varying(2000) ) WITH ( OIDS=FALSE ); ALTER TABLE liberacao OWNER TO postgres; CREATE TABLE nfs_cidades ( codmunicipio character varying(15), nomemunicipio character varying(100) ) WITH ( OIDS=FALSE ); ALTER TABLE nfs_cidades OWNER TO postgres;