CREATE TABLE resevento ( chnfe VARCHAR(50) NOT NULL, dhEvento VARCHAR(50), tpEvento VARCHAR(20) NOT NULL, nSeqEvento INTEGER UNSIGNED NOT NULL, xEvento VARCHAR(100), dhRecbto VARCHAR(50), nprot VARCHAR(30), cOrgao INTEGER UNSIGNED, nsu VARCHAR(15), cnpj VARCHAR(14), xmlResEvento LONGTEXT, cpf_cnpj VARCHAR(14), PRIMARY KEY (chnfe, tpEvento, nSeqEvento), INDEX Index_2(dhEvento, xEvento, dhRecbto, nprot, cOrgao) ) ENGINE = MyISAM; ALTER TABLE rescanc ADD COLUMN xmlprocEventoNFe LONGTEXT; ALTER TABLE rescanc MODIFY COLUMN demi VARCHAR(30) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL, MODIFY COLUMN dhrecbto VARCHAR(30) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL; ALTER TABLE rescce ADD COLUMN xmlrescce LONGTEXT; ALTER TABLE rescce ADD COLUMN cpf_cnpj VARCHAR(14); CREATE TABLE resmanifesto ( chnfe VARCHAR(50), cnpj VARCHAR(14), dhevento VARCHAR(30), tpEvento VARCHAR(10) NOT NULL, nseqevento INTEGER NOT NULL, verevento VARCHAR(10), descevento VARCHAR(50), xmlmanifesto longtext, nsu VARCHAR(20), cpf_cnpj VARCHAR(14), PRIMARY KEY (chnfe, tpEvento, nseqevento) ) ENGINE = MyISAM; CREATE TABLE resnfe_outros ( cnpj varchar(20) DEFAULT NULL, nsu varchar(15) DEFAULT NULL, chnfe varchar(44) NOT NULL, cpf_cnpj varchar(14) DEFAULT NULL, xnome varchar(100) DEFAULT NULL, ie varchar(14) DEFAULT NULL, demi varchar(20) DEFAULT NULL, tpnf varchar(1) DEFAULT NULL, vnf double DEFAULT NULL, digval varchar(30) DEFAULT NULL, dhrecbto varchar(20) DEFAULT NULL, csitnfe int(11) DEFAULT NULL, csitconf int(11) DEFAULT NULL, dataconfirmacao datetime DEFAULT NULL, datadesconhecimento datetime DEFAULT NULL, datanaorealizada datetime DEFAULT NULL, dataciencia datetime DEFAULT NULL, cstatconfirmacao int(11) DEFAULT NULL, cstatdesconhecimento int(11) DEFAULT NULL, cstatnaorealizada int(11) DEFAULT NULL, cstatciencia int(11) DEFAULT NULL, xmotivoconfirmacao varchar(255) DEFAULT NULL, xmotivodesconhecimento varchar(255) DEFAULT NULL, xmotivonaorealizada varchar(255) DEFAULT NULL, xmotivociencia varchar(255) DEFAULT NULL, dataultimoevento datetime DEFAULT NULL, csitconfultimoevento int(11) DEFAULT NULL, cstatultimoevento int(11) DEFAULT NULL, xmotivoultimoevento varchar(255) DEFAULT NULL, csitconfemcurso int(11) DEFAULT '-1', xmlconfirmacao longtext, xmldesconhecimento longtext, xmlnaorealizada longtext, xmlciencia longtext, xjust varchar(255) DEFAULT NULL, datadownload datetime DEFAULT NULL, cstatdownload int(11) DEFAULT NULL, xmotivodownload varchar(255) DEFAULT NULL, xmldownload longtext, procnfedownload longtext, xmlretdownload longtext, dataerrodownload datetime DEFAULT NULL, PRIMARY KEY (chnfe), KEY Index_2 (cnpj,nsu,chnfe,cpf_cnpj,xnome,demi,tpnf,csitnfe,csitconf) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;