--NOTAS ALTER TABLE notas ADD COLUMN dhregdpec character varying(30); ALTER TABLE notas ADD COLUMN nregdpec character varying(30); ALTER TABLE notas ADD COLUMN envdpec text; ALTER TABLE notas ADD COLUMN retdpec text; --CONFS ALTER TABLE confs ADD COLUMN bancointegracao character varying(100); ALTER TABLE confs ADD COLUMN utilizabancointegracao character varying(10); ALTER TABLE confs ADD COLUMN manifestacienciaautomatico character varying(10); ALTER TABLE confs ADD COLUMN salvatxtnotamanifestada character varying(10); ALTER TABLE confs ADD COLUMN permitirmaisdeumainstanciadaaplicacao character varying(10); ALTER TABLE confs ADD COLUMN md5 character varying(100); ALTER TABLE confs ADD COLUMN addrstorage character varying(200); ALTER TABLE confs ADD COLUMN usaloginunicoenvioemails character varying(10); ALTER TABLE confs ADD COLUMN minutosenvioemails integer; --CNPJ ALTER TABLE cnpj ADD COLUMN imprimedadoscupomrodape character varying(10); ALTER TABLE cnpj ADD COLUMN idcsc character varying(10); ALTER TABLE cnpj ADD COLUMN csc character varying(50); --LIBERACAO CREATE TABLE liberacao ( c1 bytea, c2 bytea, c3 bytea, ex character varying(2000) ) WITH (OIDS=FALSE); ALTER TABLE liberacao OWNER TO postgres; --NFS CREATE TABLE nfs_cidades ( codmunicipio character varying(15), nomemunicipio character varying(100) ) WITH ( OIDS=FALSE ); ALTER TABLE nfs_cidades OWNER TO postgres; --IMPRESSORA_ESPECIFICA ALTER TABLE impressora_especifica ADD COLUMN copias integer not null default '-1'; --CODIGOMUNICIPIOS CREATE TABLE codigosmunicipios ( codigouf integer NOT NULL, codigomunicipio integer NOT NULL, nomeuf character varying(50) NOT NULL, nomemunicipio character varying(150) NOT NULL, CONSTRAINT codigosmunicipios_pk PRIMARY KEY (codigouf,codigomunicipio) ) WITH ( OIDS=FALSE ); ALTER TABLE codigosmunicipios OWNER TO postgres; --CONDUTORES CREATE TABLE condutores ( cpf character varying(11) NOT NULL, nome character varying(60) NOT NULL, CONSTRAINT condutores_pk PRIMARY KEY (cpf) ) WITH ( OIDS=FALSE ); ALTER TABLE condutores OWNER TO postgres; --MDFE CREATE TABLE mdfe ( cnpj character varying(14) NOT NULL, numero serial NOT NULL, id character varying(48) NOT NULL, xml text, cstat character varying(5) DEFAULT NULL, xmotivo text DEFAULT NULL, data_envio timestamp without time zone DEFAULT NULL, retenvimdfe text, errogenerico text, xmlassinado text, consrecimdfe text, retconsrecimdfe text, data_retconsrecimdfe timestamp without time zone DEFAULT NULL, data_cancelamento timestamp without time zone DEFAULT NULL, motivocancelamento character varying(255) DEFAULT NULL, evcancmdfe text, retcancmdfe text, retconssitmdfe text, data_retconssitmdfe timestamp without time zone DEFAULT NULL, evencmdfe text, data_encerramento timestamp without time zone DEFAULT NULL, retevencmdfe text, CONSTRAINT mdfe_pk PRIMARY KEY (cnpj,numero) ) WITH ( OIDS=FALSE ); ALTER TABLE mdfe OWNER TO postgres; CREATE TABLE mdfe_config ( modelo integer NOT NULL, serie integer NOT NULL, tipoemitente integer NOT NULL, modalidadetransporte integer NOT NULL, formaemissao integer NOT NULL, CONSTRAINT mdfe_config_pk PRIMARY KEY (modelo) ) WITH ( OIDS=FALSE ); ALTER TABLE mdfe_config OWNER TO postgres; CREATE TABLE mdfe_inclusao_condutor ( id character varying(48) NOT NULL, nseqevento serial NOT NULL, evinccondutormdfe text, data_inclusao timestamp without time zone DEFAULT NULL, retevinccondutormdf text, cstat character varying(5) DEFAULT NULL, xmotivo text, errogenerico text, cpf character varying(11) DEFAULT NULL, nome character varying(40) DEFAULT NULL, CONSTRAINT mdfe_inclusao_condutor_pk PRIMARY KEY (id,nseqevento) ) WITH ( OIDS=FALSE ); ALTER TABLE mdfe_inclusao_condutor OWNER TO postgres; CREATE TABLE reboques ( codigointerno SERIAL NOT NULL, nome character varying(100) NOT NULL, tipocarroceria character varying(2) NOT NULL, placa character varying(10) NOT NULL, tara integer NOT NULL, renavam character varying(20) DEFAULT NULL, uf character varying(2) NOT NULL, tiporodado character varying(2) NOT NULL, capacidadekg integer DEFAULT NULL, capacidadem3 integer DEFAULT NULL, proprietarionaoemitente integer NOT NULL DEFAULT '0', nomeproprietario character varying(60) DEFAULT NULL, cpfcnpjproprietario character varying(20) DEFAULT NULL, rntrcproprietario character varying(8) DEFAULT NULL, ieproprietario character varying(14) DEFAULT NULL, ufproprietario character varying(2) DEFAULT NULL, tipoproprietario integer DEFAULT '-1', ativo integer DEFAULT '1', CONSTRAINT reboques_pk PRIMARY KEY (codigointerno) ) WITH ( OIDS=FALSE ); ALTER TABLE reboques OWNER TO postgres; CREATE TABLE veiculos ( codigointerno serial not null, nome character varying(100) NOT NULL, tipocarroceria character varying(2) NOT NULL, placa character varying(10) NOT NULL, tara integer NOT NULL, renavam character varying(20) DEFAULT NULL, uf character varying(2) NOT NULL, tiporodado character varying(2) NOT NULL, capacidadekg integer DEFAULT NULL, capacidadem3 integer DEFAULT NULL, proprietarionaoemitente integer NOT NULL DEFAULT '0', nomeproprietario character varying(60) DEFAULT NULL, cpfcnpjproprietario character varying(20) DEFAULT NULL, rntrcproprietario character varying(8) DEFAULT NULL, ieproprietario character varying(14) DEFAULT NULL, ufproprietario character varying(2) DEFAULT NULL, tipoproprietario integer DEFAULT '-1', ativo integer DEFAULT '1', CONSTRAINT veiculos_pk PRIMARY KEY (codigointerno) ) WITH ( OIDS=FALSE ); ALTER TABLE veiculos OWNER TO postgres;