ALTER TABLE NOTAS ADD COLUMN XMLCANCELAMENTO LONGTEXT AFTER PDF, ADD COLUMN XMLINUTILIZACAO LONGTEXT AFTER XMLCANCELAMENTO; CREATE TABLE IMPRESSORA_ESPECIFICA ( IDNOTA VARCHAR(50) NOT NULL, IMPRESSORA VARCHAR(500) NOT NULL, PRIMARY KEY (IDNOTA,IMPRESSORA) ) ENGINE=MYISAM DEFAULT CHARSET=LATIN1; ALTER TABLE NOTAS ADD COLUMN DATA_EMAIL_CANCELAMENTO DATE AFTER XMLINUTILIZACAO; ALTER TABLE NOTAS ADD COLUMN XMLCANCELAMENTOSIGNED LONGTEXT AFTER DATA_EMAIL_CANCELAMENTO; ALTER TABLE NOTAS ADD COLUMN XMLINUTILIZACAOSIGNED LONGTEXT AFTER XMLCANCELAMENTOSIGNED; ALTER TABLE cnpj ADD COLUMN idcsc character varying(10); ALTER TABLE cnpj ADD COLUMN csc character varying(50); CREATE TABLE carta_correcao ( IDNOTA varchar(50) NOT NULL, DATA_ENVIO datetime DEFAULT NULL, XMLASSINADO longtext, CSTAT int(11) DEFAULT NULL, XMOTIVO longtext, IDEVENTO varchar(60) NOT NULL, CSTAT_CC int(10) unsigned DEFAULT NULL, XMOTIVO_CC longtext, XMLRETORNO longtext, SEQ int(10) unsigned NOT NULL AUTO_INCREMENT, DATA_EMAIL datetime DEFAULT NULL, PRIMARY KEY (SEQ) ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; ALTER TABLE CARTA_CORRECAO ADD COLUMN DATA_IMPRESSAO DATETIME AFTER DATA_EMAIL; ALTER TABLE nfs ADD COLUMN XMLRETORNO TEXT AFTER DATA_IMPRESSAO; ALTER TABLE notas ADD COLUMN dhregdpec VARCHAR(30) AFTER XMLINUTILIZACAOSIGNED, ADD COLUMN nregdpec VARCHAR(30) AFTER dhregdpec, ADD COLUMN envdpec LONGTEXT AFTER nregdpec, ADD COLUMN retdpec LONGTEXT AFTER envdpec; CREATE TABLE cnpj ( cnpj VARCHAR(20), razao VARCHAR(200), codigocertificado VARCHAR(100), senhacertificado VARCHAR(100), ambiente VARCHAR(2), uf VARCHAR(2), usaimpressao VARCHAR(10), impressora VARCHAR(500), numcopia VARCHAR(2), codigocertificadonfs VARCHAR(100), senhacertificadonfs VARCHAR(100), ambientenfs VARCHAR(2), ufnfs VARCHAR(2), pathlogo VARCHAR(500), enviapdf VARCHAR(10), envianotas VARCHAR(10), informacoesadicionaisobsrodape VARCHAR(2000), emailavisomanifestacaonota VARCHAR(500) ) ENGINE = MyISAM; ALTER TABLE cnpj ADD COLUMN emailavisomanifestacaonota VARCHAR(500) AFTER informacoesadicionaisobsrodape; CREATE TABLE cnpjnsu ( cnpj varchar(20), tpamb int(11), veraplic varchar(5), cstat int(11), xmotivo varchar(300), dhresp varchar(50), indcont int(11), ultnsu varchar(50) ) ENGINE = MyISAM; CREATE TABLE confs ( dirinput VARCHAR(500), versao VARCHAR(10), portabanco VARCHAR(10), servidor VARCHAR(100), banco VARCHAR(100), usuario VARCHAR(100), senha VARCHAR(100), removearqtemps VARCHAR(10), dirapp VARCHAR(500), dioutputsoluma VARCHAR(500), usaproxy VARCHAR(10), endproxy VARCHAR(500), userproxy VARCHAR(100), senhaproxy VARCHAR(100), portaproxy VARCHAR(10), diroutputnfeentrada VARCHAR(500), popentrada VARCHAR(500), smtpentrada VARCHAR(500), userentrada VARCHAR(100), passentrada VARCHAR(100), tempochecamail VARCHAR(10), addrentrada VARCHAR(100), checaentrada VARCHAR(10), enviaxmlmail VARCHAR(10), popmonitoramento VARCHAR(500), smtpmonitoramento VARCHAR(500), usermonitoramento VARCHAR(100), passmonitoramento VARCHAR(100), addrmonitoramento VARCHAR(100), processanotasabrasf VARCHAR(10), portapopentrada VARCHAR(10), portasmtpentrada VARCHAR(10), portapopmonitoramento VARCHAR(10), portasmtpmonitoramento VARCHAR(10), sslentrada VARCHAR(10), sslmonitoramento VARCHAR(10), emailredir VARCHAR(500), versaolayoutnota VARCHAR(10), somentecompdf VARCHAR(10), addrerrosmail VARCHAR(100), usacontigencia VARCHAR(10), seriecontigencia VARCHAR(10), envianotacontigencia VARCHAR(10), emailerrosnotaentrada VARCHAR(500), protocolobanco VARCHAR(100), usarepositorionotas VARCHAR(10), dirrepositorionotas VARCHAR(500) ) ENGINE = MyISAM; CREATE TABLE rescanc ( cnpj varchar(20), nsu varchar(15), chnfe varchar(44), cpf_cnpj varchar(14), xnome varchar(100), ie varchar(14), demi varchar(20), tpnf varchar(1), vnf double, digval varchar(30), dhrecbto varchar(20), csitnfe int(11), csitconf int(11) ) ENGINE = MyISAM; CREATE TABLE rescce ( cnpj varchar(20), nsu varchar(15), chnfe varchar(44), dhevento varchar(40), tpevento varchar(6), nseqevento varchar(2), descevento varchar(60), xcorrecao longtext, tpnf varchar(1), dhrecbto varchar(40) ) ENGINE = MyISAM; CREATE TABLE resnfe ( cnpj varchar(20), nsu varchar(15), chnfe varchar(44), cpf_cnpj varchar(14), xnome varchar(100), ie varchar(14), demi varchar(20), tpnf varchar(1), vnf double , digval varchar(30), dhrecbto varchar(20), csitnfe int(11), csitconf int(11), dataconfirmacao datetime, datadesconhecimento datetime, datanaorealizada datetime, dataciencia datetime, cstatconfirmacao int(11), cstatdesconhecimento int(11), cstatnaorealizada int(11), cstatciencia int(11), xmotivoconfirmacao varchar(255), xmotivodesconhecimento varchar(255), xmotivonaorealizada varchar(255), xmotivociencia varchar(255), dataultimoevento datetime, csitconfultimoevento int(11), cstatultimoevento int(11), xmotivoultimoevento varchar(255), csitconfemcurso int(11) DEFAULT -1, xmlconfirmacao text, xmldesconhecimento text, xmlnaorealizada text, xmlciencia text, xjust varchar(255), datadownload datetime, cstatdownload int(11), xmotivodownload varchar(255), xmldownload text, procnfedownload text, xmlretdownload text, dataerrodownload datetime ) ENGINE = MyISAM; CREATE TABLE usuarios ( usr varchar(100), pwd varchar(100), tipo varchar(10), cnpjs longtext, nfeacess int(11), nfeimp int(11), nfecons int(11), nfexml int(11), nfesave int(11), nfemail int(11), cceacess int(11), cceimp int(11), ccexml int(11), ccesave int(11), ccemail int(11), resnfensu int(11), resnfeacess int(11), resnfedetail int(11), resnfemanifesta int(11), resnfexml int(11), resnfesave int(11), emailacess int(11), emailclear int(11) )ENGINE = MyISAM; ALTER TABLE cnpj MODIFY COLUMN cnpj VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, ADD PRIMARY KEY (cnpj); ALTER TABLE cnpjnsu MODIFY COLUMN cnpj VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, ADD PRIMARY KEY (cnpj); ALTER TABLE rescanc MODIFY COLUMN chnfe VARCHAR(44) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, ADD PRIMARY KEY (chnfe), ADD INDEX Index_2(cnpj, nsu, chnfe, cpf_cnpj, xnome); ALTER TABLE rescce MODIFY COLUMN cnpj VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, ADD INDEX Index_1(cnpj, nsu, chnfe, dhevento, tpevento, nseqevento); ALTER TABLE resnfe MODIFY COLUMN chnfe VARCHAR(44) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, ADD PRIMARY KEY (chnfe), ADD INDEX Index_2(cnpj, nsu, chnfe, cpf_cnpj, xnome, demi, tpnf, csitnfe, csitconf); ALTER TABLE usuarios MODIFY COLUMN usr VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, MODIFY COLUMN pwd VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, MODIFY COLUMN tipo VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, ADD PRIMARY KEY (usr); ALTER TABLE confs ADD COLUMN bancointegracao VARCHAR(500) AFTER dirrepositorionotas; ALTER TABLE confs ADD COLUMN utilizabancointegracao VARCHAR(10) AFTER bancointegracao; ALTER TABLE impressora_especifica ADD COLUMN COPIAS INTEGER NOT NULL DEFAULT '-1' AFTER IMPRESSORA; ALTER TABLE resnfe MODIFY COLUMN xmlconfirmacao LONGTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL, MODIFY COLUMN xmldesconhecimento LONGTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL, MODIFY COLUMN xmlnaorealizada LONGTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL, MODIFY COLUMN xmlciencia LONGTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL, MODIFY COLUMN xmldownload LONGTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL, MODIFY COLUMN procnfedownload LONGTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL, MODIFY COLUMN xmlretdownload LONGTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL; ALTER TABLE confs ADD COLUMN manifestacienciaautomatico VARCHAR(10) AFTER utilizabancointegracao; ALTER TABLE cnpj ADD COLUMN logo BLOB AFTER emailavisomanifestacaonota; ALTER TABLE cnpj ADD COLUMN imprimedadoscupomrodape VARCHAR(10); ALTER TABLE confs ADD COLUMN salvatxtnotamanifestada VARCHAR(10); CREATE TABLE `liberacao` ( `c1` blob, `c2` blob, `c3` blob, `ex` varchar(2000) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; ALTER TABLE confs ADD COLUMN permitirmaisdeumainstanciadaaplicacao VARCHAR(10); ALTER TABLE confs ADD COLUMN md5 VARCHAR(100); ALTER TABLE confs ADD COLUMN addrstorage VARCHAR(200); CREATE TABLE nfs_cidades ( codmunicipio varchar(15), nomemunicipio varchar(100) ); ALTER TABLE confs ADD COLUMN usaloginunicoenvioemails VARCHAR(10); ALTER TABLE confs ADD COLUMN minutosenvioemails int(11); CREATE TABLE codigosmunicipios ( codigouf int(10) unsigned NOT NULL, codigomunicipio int(10) unsigned NOT NULL, nomeuf varchar(50) NOT NULL, nomemunicipio varchar(150) NOT NULL, PRIMARY KEY (codigouf,codigomunicipio) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE condutores ( cpf varchar(11) NOT NULL, nome varchar(60) NOT NULL, PRIMARY KEY (cpf) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE mdfe ( cnpj varchar(14) NOT NULL, numero int(11) NOT NULL AUTO_INCREMENT, id varchar(48) NOT NULL, xml longtext, cstat varchar(5) DEFAULT NULL, xmotivo longtext DEFAULT NULL, data_envio datetime DEFAULT NULL, retenvimdfe longtext, errogenerico longtext, xmlassinado longtext, consrecimdfe longtext, retconsrecimdfe longtext, data_retconsrecimdfe datetime DEFAULT NULL, data_cancelamento datetime DEFAULT NULL, motivocancelamento varchar(255) DEFAULT NULL, evcancmdfe longtext, retcancmdfe longtext, retconssitmdfe longtext, data_retconssitmdfe datetime DEFAULT NULL, evencmdfe longtext, data_encerramento datetime DEFAULT NULL, retevencmdfe longtext, PRIMARY KEY (cnpj,numero) USING BTREE ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE mdfe_config ( modelo int(11) NOT NULL, serie int(11) NOT NULL, tipoemitente int(11) NOT NULL, modalidadetransporte int(11) NOT NULL, formaemissao int(11) NOT NULL, PRIMARY KEY (modelo) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE mdfe_inclusao_condutor ( id varchar(48) NOT NULL, nseqevento int(11) NOT NULL AUTO_INCREMENT, evinccondutormdfe longtext, data_inclusao datetime DEFAULT NULL, retevinccondutormdf longtext, cstat varchar(5) DEFAULT NULL, xmotivo longtext, errogenerico longtext, cpf varchar(11) DEFAULT NULL, nome varchar(40) DEFAULT NULL, PRIMARY KEY (id,nseqevento) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE reboques ( codigointerno int(10) unsigned NOT NULL AUTO_INCREMENT, nome varchar(100) NOT NULL, tipocarroceria varchar(2) NOT NULL, placa varchar(10) NOT NULL, tara int(11) NOT NULL, renavam varchar(20) DEFAULT NULL, uf varchar(2) NOT NULL, tiporodado varchar(2) NOT NULL, capacidadekg int(11) DEFAULT NULL, capacidadem3 int(11) DEFAULT NULL, proprietarionaoemitente tinyint(1) NOT NULL DEFAULT '0', nomeproprietario varchar(60) DEFAULT NULL, cpfcnpjproprietario varchar(20) DEFAULT NULL, rntrcproprietario varchar(8) DEFAULT NULL, ieproprietario varchar(14) DEFAULT NULL, ufproprietario varchar(2) DEFAULT NULL, tipoproprietario int(11) DEFAULT '-1', ativo tinyint(1) DEFAULT '1', PRIMARY KEY (codigointerno) ) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; CREATE TABLE veiculos ( codigointerno int(10) unsigned NOT NULL AUTO_INCREMENT, nome varchar(100) NOT NULL, tipocarroceria varchar(2) NOT NULL, placa varchar(10) NOT NULL, tara int(11) NOT NULL, renavam varchar(20) DEFAULT NULL, uf varchar(2) NOT NULL, tiporodado varchar(2) NOT NULL, capacidadekg int(11) DEFAULT NULL, capacidadem3 int(11) DEFAULT NULL, proprietarionaoemitente tinyint(1) NOT NULL DEFAULT '0', nomeproprietario varchar(60) DEFAULT NULL, cpfcnpjproprietario varchar(20) DEFAULT NULL, rntrcproprietario varchar(8) DEFAULT NULL, ieproprietario varchar(14) DEFAULT NULL, ufproprietario varchar(2) DEFAULT NULL, tipoproprietario int(11) DEFAULT '-1', ativo tinyint(1) DEFAULT '1', PRIMARY KEY (codigointerno) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;