Commit 4e9c322c193e92c1ccebdbd7b04bc7f66e4568b9
1 parent
9c007cca2d
Exists in
master
no dependency Promise2
Showing
47 changed files
with
711 additions
and
866 deletions
Show diff stats
.gitignore
README.md
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 | Pasos a seguir instalación y primera migración: |
4 | 4 | |
5 | 5 | - Una vez bajado el proyecto correr el siguiente comando en consola si es la primera ve(se debe tener instalado node): |
6 | -> npm install -g knex && npm install && knex init | |
6 | +> npm run init | |
7 | 7 | - Una vez ejecutado el comando se ha creado el archivo `knexfile.js`, configurar la base de datos deseada. |
8 | 8 | - En consola correr el comando |
9 | 9 | > knex migrate:latest --env nombreConfiguracion |
migrations/20181123153918_v0.1.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.createTable('nota_pedido', function(table) { | |
5 | - table.increments(); | |
6 | - table.integer('bomba'); | |
7 | - table.integer('cotizacion'); | |
8 | - table.string('cuitCliente'); | |
9 | - table.string('domicilioStamp'); | |
10 | - table.integer('estado'); | |
11 | - table.dateTime('fechaCarga'); | |
12 | - table.integer('flete'); | |
13 | - table.integer('fob'); | |
14 | - table.decimal('kilometros', 12, 2); | |
15 | - table.string('nombreCliente'); | |
16 | - table.integer('numeroNotaPedido'); | |
17 | - table.integer('responsabilidadIvaCliente'); | |
18 | - table.integer('sucursal'); | |
19 | - table.decimal('total', 12, 2); | |
20 | - table.bigInteger('idCliente').unsigned(); | |
21 | - table.bigInteger('idCotizacion').unsigned(); | |
22 | - table.bigInteger('idDomicilio').unsigned(); | |
23 | - table.bigInteger('idPrecioCondicion').unsigned(); | |
24 | - table.bigInteger('idProveedor').unsigned(); | |
25 | - table.bigInteger('idRemito').unsigned(); | |
26 | - table.bigInteger('idVendedor').unsigned(); | |
27 | - }).createTable('precios_condiciones', function(table) { | |
28 | - table.increments(); | |
29 | - table.boolean('activo'); | |
30 | - table.string('codigo'); | |
31 | - table.string('descripcion'); | |
32 | - table.string('nombre'); | |
33 | - table.date('vigencia'); | |
34 | - table.bigInteger('idListaPrecio').unsigned(); | |
35 | - }).createTable('plazo_pago', function(table) { | |
36 | - table.increments(); | |
37 | - table.boolean('activo'); | |
38 | - table.integer('dias'); | |
39 | - table.integer('item'); | |
40 | - table.bigInteger('idPreciosCondiciones').unsigned(); | |
41 | - }).createTable('articulo_nota_pedido', function(table) { | |
42 | - table.increments(); | |
43 | - table.decimal('cantidad', 12, 2); | |
44 | - table.string('codigo'); | |
45 | - table.boolean('combustible'); | |
46 | - table.decimal('costoUnitario', 12, 2); | |
47 | - table.string('descripcion'); | |
48 | - table.decimal('exentoUnitario', 12, 2); | |
49 | - table.boolean('facturado'); | |
50 | - table.decimal('impuestoInternoUnitario', 12, 2); | |
51 | - table.decimal('impuestoInterno1Unitario', 12, 2); | |
52 | - table.decimal('impuestoInterno2Unitario', 12, 2); | |
53 | - table.integer('item'); | |
54 | - table.decimal('ivaUnitario', 12, 2); | |
55 | - table.decimal('ivaServicioUnitario', 12, 2); | |
56 | - table.string('nombre'); | |
57 | - table.decimal('precio', 12, 4); | |
58 | - table.decimal('precioLista', 12, 2); | |
59 | - table.integer('sector'); | |
60 | - table.integer('rubro'); | |
61 | - table.decimal('tasaIva', 12, 2); | |
62 | - table.bigInteger('idNotaPedido').unsigned(); | |
63 | - }).createTable('boton', function(table) { | |
64 | - table.increments(); | |
65 | - table.string('accion'); | |
66 | - table.string('app'); | |
67 | - table.string('clase'); | |
68 | - table.string('texto'); | |
69 | - }).createTable('chofer', function(table) { | |
70 | - table.increments(); | |
71 | - table.string('dni'); | |
72 | - table.string('nombre'); | |
73 | - table.string('telefono'); | |
74 | - table.bigInteger('idTransportista').unsigned(); | |
75 | - }).createTable('vehiculo', function(table) { | |
76 | - table.increments(); | |
77 | - table.string('capacidad'); | |
78 | - table.string('cisternado'); | |
79 | - table.string('semi'); | |
80 | - table.string('tractor'); | |
81 | - table.bigInteger('idTransportista').unsigned(); | |
82 | - // TODO: Revisar si en los seeds no inserta por ser nombres de campo demasiado largos. | |
83 | - // table.string('seguimientoSatelitalUrl'); | |
84 | - // table.string('seguimientoSatelitalUsuario'); | |
85 | - // table.string('seguimientoSatelitalClave'); | |
86 | - }).createTable('nota-pedido-plazo', function(table) { | |
87 | - table.increments(); | |
88 | - table.integer('dias').unsigned(); | |
89 | - table.bigInteger('idNotaPedido').unsigned(); | |
90 | - }).createTable('seguimiento', function(table) { | |
91 | - table.increments(); | |
92 | - table.string('actividad'); | |
93 | - table.integer('distancia'); | |
94 | - table.dateTime('fecha'); | |
95 | - table.string('latitud'); | |
96 | - table.string('longitud'); | |
97 | - table.string('observaciones'); | |
98 | - table.integer('orden'); | |
99 | - table.bigInteger('idUsuario').unsigned(); | |
100 | - }).createTable('nota-pedido-estado', function(table) { | |
101 | - table.increments(); | |
102 | - table.integer('estado'); | |
103 | - table.dateTime('fecha'); | |
104 | - table.bigInteger('idNotaPedido').unsigned(); | |
105 | - table.integer('idVendedor').unsigned(); | |
106 | - }).createTable('configuracion_terminal', function(table) { | |
107 | - table.increments(); | |
108 | - table.string('terminalKey'); | |
109 | - table.string('valor'); | |
110 | - table.string('variable'); | |
111 | - }).createTable('remito', function(table) { | |
112 | - table.increments(); | |
113 | - table.boolean('anulado'); | |
114 | - table.integer('asiento'); | |
115 | - table.integer('bomba'); | |
116 | - table.decimal('carga', 12, 2); | |
117 | - table.string('cuitCliente'); | |
118 | - table.integer('cuentaContable'); | |
119 | - table.integer('cuentaMadre'); | |
120 | - table.decimal('descuento', 12, 2); | |
121 | - table.integer('destinoVenta'); | |
122 | - table.string('domicilioStamp'); | |
123 | - table.integer('estado'); | |
124 | - table.dateTime('fechaRemito'); | |
125 | - table.integer('flete'); | |
126 | - table.integer('fob'); | |
127 | - table.decimal('importeExento', 12, 2); | |
128 | - table.decimal('importeImpuestoInterno', 12, 2); | |
129 | - table.decimal('importeImpuestoInterno1', 12, 2); | |
130 | - table.decimal('importeImpuestoInterno2', 12, 2); | |
131 | - table.decimal('importeIva', 12, 2); | |
132 | - table.decimal('importeIvaServicios', 12, 2); | |
133 | - table.decimal('importeNeto', 12, 2); | |
134 | - table.decimal('kilometros', 12, 2); | |
135 | - table.integer('lugar'); | |
136 | - table.string('nombreCliente'); | |
137 | - table.integer('numeroLiquidoProducto'); | |
138 | - table.integer('numeroNotaPedido'); | |
139 | - table.integer('numeroRemito'); | |
140 | - table.integer('operacionTipo'); | |
141 | - table.decimal('percepcion', 12, 2); | |
142 | - table.decimal('percepcionIva', 12, 2); | |
143 | - table.integer('planilla'); | |
144 | - table.integer('sucursal'); | |
145 | - table.decimal('redondeo', 12, 2); | |
146 | - table.integer('responsabilidadIvaCliente'); | |
147 | - table.decimal('total', 12, 2); | |
148 | - table.bigInteger('idVendedor').unsigned(); | |
149 | - table.bigInteger('idProveedor').unsigned(); | |
150 | - table.bigInteger('idDomicilio').unsigned(); | |
151 | - table.bigInteger('idCotizacion').unsigned(); | |
152 | - table.bigInteger('idPrecioCondicion').unsigned(); | |
153 | - table.bigInteger('idHojaRuta').unsigned(); | |
154 | - table.bigInteger('idCliente').unsigned(); | |
155 | - table.string('e_hd'); | |
156 | - table.string('c_hd'); | |
157 | - }).createTable('articulo_remito', function(table) { | |
158 | - table.increments(); | |
159 | - table.decimal('cantidad', 12, 2); | |
160 | - table.string('codigo'); | |
161 | - table.boolean('combustible'); | |
162 | - table.decimal('costoUnitario', 12, 2); | |
163 | - table.string('descripcion'); | |
164 | - table.decimal('exentoUnitario', 12, 2); | |
165 | - table.boolean('facturado'); | |
166 | - table.integer('item'); | |
167 | - table.decimal('impuestoInternoUnitario', 12, 2); | |
168 | - table.decimal('impuestoInterno1Unitario', 12, 2); | |
169 | - table.decimal('impuestoInterno2Unitario', 12, 2); | |
170 | - table.decimal('ivaServicioUnitario', 12, 2); | |
171 | - table.decimal('ivaUnitario', 12, 2); | |
172 | - table.string('nombre'); | |
173 | - table.decimal('precio', 12, 4); | |
174 | - table.decimal('precioLista', 12, 2); | |
175 | - table.integer('sector'); | |
176 | - table.integer('rubro'); | |
177 | - table.decimal('tasaIva', 12, 2); | |
178 | - table.bigInteger('idRemito').unsigned(); | |
179 | - }).createTable('hoja_ruta', function(table) { | |
180 | - table.increments(); | |
181 | - table.dateTime('fechaCreacion'); | |
182 | - table.bigInteger('numeroHojaRuta').unsigned(); | |
183 | - table.integer('sucursal').unsigned(); | |
184 | - table.decimal('tarifaFlete', 12, 2); | |
185 | - table.bigInteger('idTransportista').unsigned(); | |
186 | - table.bigInteger('idChofer').unsigned(); | |
187 | - table.bigInteger('idVehiculo').unsigned(); | |
188 | - }) | |
189 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.createTable('nota_pedido', function(table) { | |
4 | + table.increments(); | |
5 | + table.integer('bomba'); | |
6 | + table.integer('cotizacion'); | |
7 | + table.string('cuitCliente'); | |
8 | + table.string('domicilioStamp'); | |
9 | + table.integer('estado'); | |
10 | + table.dateTime('fechaCarga'); | |
11 | + table.integer('flete'); | |
12 | + table.integer('fob'); | |
13 | + table.decimal('kilometros', 12, 2); | |
14 | + table.string('nombreCliente'); | |
15 | + table.integer('numeroNotaPedido'); | |
16 | + table.integer('responsabilidadIvaCliente'); | |
17 | + table.integer('sucursal'); | |
18 | + table.decimal('total', 12, 2); | |
19 | + table.bigInteger('idCliente').unsigned(); | |
20 | + table.bigInteger('idCotizacion').unsigned(); | |
21 | + table.bigInteger('idDomicilio').unsigned(); | |
22 | + table.bigInteger('idPrecioCondicion').unsigned(); | |
23 | + table.bigInteger('idProveedor').unsigned(); | |
24 | + table.bigInteger('idRemito').unsigned(); | |
25 | + table.bigInteger('idVendedor').unsigned(); | |
26 | + }).createTable('precios_condiciones', function(table) { | |
27 | + table.increments(); | |
28 | + table.boolean('activo'); | |
29 | + table.string('codigo'); | |
30 | + table.string('descripcion'); | |
31 | + table.string('nombre'); | |
32 | + table.date('vigencia'); | |
33 | + table.bigInteger('idListaPrecio').unsigned(); | |
34 | + }).createTable('plazo_pago', function(table) { | |
35 | + table.increments(); | |
36 | + table.boolean('activo'); | |
37 | + table.integer('dias'); | |
38 | + table.integer('item'); | |
39 | + table.bigInteger('idPreciosCondiciones').unsigned(); | |
40 | + }).createTable('articulo_nota_pedido', function(table) { | |
41 | + table.increments(); | |
42 | + table.decimal('cantidad', 12, 2); | |
43 | + table.string('codigo'); | |
44 | + table.boolean('combustible'); | |
45 | + table.decimal('costoUnitario', 12, 2); | |
46 | + table.string('descripcion'); | |
47 | + table.decimal('exentoUnitario', 12, 2); | |
48 | + table.boolean('facturado'); | |
49 | + table.decimal('impuestoInternoUnitario', 12, 2); | |
50 | + table.decimal('impuestoInterno1Unitario', 12, 2); | |
51 | + table.decimal('impuestoInterno2Unitario', 12, 2); | |
52 | + table.integer('item'); | |
53 | + table.decimal('ivaUnitario', 12, 2); | |
54 | + table.decimal('ivaServicioUnitario', 12, 2); | |
55 | + table.string('nombre'); | |
56 | + table.decimal('precio', 12, 4); | |
57 | + table.decimal('precioLista', 12, 2); | |
58 | + table.integer('sector'); | |
59 | + table.integer('rubro'); | |
60 | + table.decimal('tasaIva', 12, 2); | |
61 | + table.bigInteger('idNotaPedido').unsigned(); | |
62 | + }).createTable('boton', function(table) { | |
63 | + table.increments(); | |
64 | + table.string('accion'); | |
65 | + table.string('app'); | |
66 | + table.string('clase'); | |
67 | + table.string('texto'); | |
68 | + }).createTable('chofer', function(table) { | |
69 | + table.increments(); | |
70 | + table.string('dni'); | |
71 | + table.string('nombre'); | |
72 | + table.string('telefono'); | |
73 | + table.bigInteger('idTransportista').unsigned(); | |
74 | + }).createTable('vehiculo', function(table) { | |
75 | + table.increments(); | |
76 | + table.string('capacidad'); | |
77 | + table.string('cisternado'); | |
78 | + table.string('semi'); | |
79 | + table.string('tractor'); | |
80 | + table.bigInteger('idTransportista').unsigned(); | |
81 | + // TODO: Revisar si en los seeds no inserta por ser nombres de campo demasiado largos. | |
82 | + // table.string('seguimientoSatelitalUrl'); | |
83 | + // table.string('seguimientoSatelitalUsuario'); | |
84 | + // table.string('seguimientoSatelitalClave'); | |
85 | + }).createTable('nota-pedido-plazo', function(table) { | |
86 | + table.increments(); | |
87 | + table.integer('dias').unsigned(); | |
88 | + table.bigInteger('idNotaPedido').unsigned(); | |
89 | + }).createTable('seguimiento', function(table) { | |
90 | + table.increments(); | |
91 | + table.string('actividad'); | |
92 | + table.integer('distancia'); | |
93 | + table.dateTime('fecha'); | |
94 | + table.string('latitud'); | |
95 | + table.string('longitud'); | |
96 | + table.string('observaciones'); | |
97 | + table.integer('orden'); | |
98 | + table.bigInteger('idUsuario').unsigned(); | |
99 | + }).createTable('nota-pedido-estado', function(table) { | |
100 | + table.increments(); | |
101 | + table.integer('estado'); | |
102 | + table.dateTime('fecha'); | |
103 | + table.bigInteger('idNotaPedido').unsigned(); | |
104 | + table.integer('idVendedor').unsigned(); | |
105 | + }).createTable('configuracion_terminal', function(table) { | |
106 | + table.increments(); | |
107 | + table.string('terminalKey'); | |
108 | + table.string('valor'); | |
109 | + table.string('variable'); | |
110 | + }).createTable('remito', function(table) { | |
111 | + table.increments(); | |
112 | + table.boolean('anulado'); | |
113 | + table.integer('asiento'); | |
114 | + table.integer('bomba'); | |
115 | + table.decimal('carga', 12, 2); | |
116 | + table.string('cuitCliente'); | |
117 | + table.integer('cuentaContable'); | |
118 | + table.integer('cuentaMadre'); | |
119 | + table.decimal('descuento', 12, 2); | |
120 | + table.integer('destinoVenta'); | |
121 | + table.string('domicilioStamp'); | |
122 | + table.integer('estado'); | |
123 | + table.dateTime('fechaRemito'); | |
124 | + table.integer('flete'); | |
125 | + table.integer('fob'); | |
126 | + table.decimal('importeExento', 12, 2); | |
127 | + table.decimal('importeImpuestoInterno', 12, 2); | |
128 | + table.decimal('importeImpuestoInterno1', 12, 2); | |
129 | + table.decimal('importeImpuestoInterno2', 12, 2); | |
130 | + table.decimal('importeIva', 12, 2); | |
131 | + table.decimal('importeIvaServicios', 12, 2); | |
132 | + table.decimal('importeNeto', 12, 2); | |
133 | + table.decimal('kilometros', 12, 2); | |
134 | + table.integer('lugar'); | |
135 | + table.string('nombreCliente'); | |
136 | + table.integer('numeroLiquidoProducto'); | |
137 | + table.integer('numeroNotaPedido'); | |
138 | + table.integer('numeroRemito'); | |
139 | + table.integer('operacionTipo'); | |
140 | + table.decimal('percepcion', 12, 2); | |
141 | + table.decimal('percepcionIva', 12, 2); | |
142 | + table.integer('planilla'); | |
143 | + table.integer('sucursal'); | |
144 | + table.decimal('redondeo', 12, 2); | |
145 | + table.integer('responsabilidadIvaCliente'); | |
146 | + table.decimal('total', 12, 2); | |
147 | + table.bigInteger('idVendedor').unsigned(); | |
148 | + table.bigInteger('idProveedor').unsigned(); | |
149 | + table.bigInteger('idDomicilio').unsigned(); | |
150 | + table.bigInteger('idCotizacion').unsigned(); | |
151 | + table.bigInteger('idPrecioCondicion').unsigned(); | |
152 | + table.bigInteger('idHojaRuta').unsigned(); | |
153 | + table.bigInteger('idCliente').unsigned(); | |
154 | + table.string('e_hd'); | |
155 | + table.string('c_hd'); | |
156 | + }).createTable('articulo_remito', function(table) { | |
157 | + table.increments(); | |
158 | + table.decimal('cantidad', 12, 2); | |
159 | + table.string('codigo'); | |
160 | + table.boolean('combustible'); | |
161 | + table.decimal('costoUnitario', 12, 2); | |
162 | + table.string('descripcion'); | |
163 | + table.decimal('exentoUnitario', 12, 2); | |
164 | + table.boolean('facturado'); | |
165 | + table.integer('item'); | |
166 | + table.decimal('impuestoInternoUnitario', 12, 2); | |
167 | + table.decimal('impuestoInterno1Unitario', 12, 2); | |
168 | + table.decimal('impuestoInterno2Unitario', 12, 2); | |
169 | + table.decimal('ivaServicioUnitario', 12, 2); | |
170 | + table.decimal('ivaUnitario', 12, 2); | |
171 | + table.string('nombre'); | |
172 | + table.decimal('precio', 12, 4); | |
173 | + table.decimal('precioLista', 12, 2); | |
174 | + table.integer('sector'); | |
175 | + table.integer('rubro'); | |
176 | + table.decimal('tasaIva', 12, 2); | |
177 | + table.bigInteger('idRemito').unsigned(); | |
178 | + }).createTable('hoja_ruta', function(table) { | |
179 | + table.increments(); | |
180 | + table.dateTime('fechaCreacion'); | |
181 | + table.bigInteger('numeroHojaRuta').unsigned(); | |
182 | + table.integer('sucursal').unsigned(); | |
183 | + table.decimal('tarifaFlete', 12, 2); | |
184 | + table.bigInteger('idTransportista').unsigned(); | |
185 | + table.bigInteger('idChofer').unsigned(); | |
186 | + table.bigInteger('idVehiculo').unsigned(); | |
187 | + }); | |
190 | 188 | }; |
191 | 189 | |
192 | -exports.down = function(knex, Promise) { | |
193 | - return Promise.all([ | |
194 | - knex.schema | |
190 | +exports.down = function(knex) { | |
191 | + return knex.schema | |
195 | 192 | .dropTable('nota_pedido') |
196 | 193 | .dropTable('precios_condiciones') |
197 | 194 | .dropTable('plazo_pago') |
... | ... | @@ -206,5 +203,4 @@ exports.down = function(knex, Promise) { |
206 | 203 | .dropTable('remito') |
207 | 204 | .dropTable('articulo_remito') |
208 | 205 | .dropTable('hoja_ruta') |
209 | - ]); | |
210 | 206 | }; |
migrations/20181127121352_v0.1.1.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.table('APAREMP', function(table) { | |
5 | - table.decimal('latitud', 10, 7); | |
6 | - table.decimal('longitud', 10, 7); | |
7 | - }) | |
8 | - ]) | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.table('APAREMP', function(table) { | |
4 | + table.decimal('latitud', 10, 7); | |
5 | + table.decimal('longitud', 10, 7); | |
6 | + }); | |
9 | 7 | }; |
10 | 8 | |
11 | -exports.down = function(knex, Promise) { | |
12 | - return Promise.all([ | |
13 | - knex.schema.table('APAREMP', function(table) { | |
14 | - table.dropColumn('latitud'); | |
15 | - table.dropColumn('longitud'); | |
16 | - }) | |
17 | - ]) | |
9 | +exports.down = function(knex) { | |
10 | + return knex.schema.table('APAREMP', function(table) { | |
11 | + table.dropColumn('latitud'); | |
12 | + table.dropColumn('longitud'); | |
13 | + }); | |
18 | 14 | }; |
migrations/20181129105456_v0.2.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.table('vehiculo', function(table) { | |
4 | - table.boolean('desactivado'); | |
5 | - }).alterTable('chofer', function(table) { | |
6 | - table.boolean('desactivado'); | |
7 | - }) | |
8 | - ]); | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.table('vehiculo', function(table) { | |
3 | + table.boolean('desactivado'); | |
4 | + }).alterTable('chofer', function(table) { | |
5 | + table.boolean('desactivado'); | |
6 | + }); | |
9 | 7 | }; |
10 | 8 | |
11 | -exports.down = function(knex, Promise) { | |
12 | - return Promise.all([ | |
13 | - knex.schema.table('vehiculo', function(table) { | |
14 | - table.dropColumn('desactivado'); | |
15 | - }).alterTable('chofer', function(table) { | |
16 | - table.dropColumn('desactivado'); | |
17 | - }) | |
18 | - ]); | |
9 | +exports.down = function(knex) { | |
10 | + return knex.schema.table('vehiculo', function(table) { | |
11 | + table.dropColumn('desactivado'); | |
12 | + }).alterTable('chofer', function(table) { | |
13 | + table.dropColumn('desactivado'); | |
14 | + }); | |
19 | 15 | }; |
migrations/20181130113831_v0.3.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.createTable('cobrador', function(table) { | |
4 | - table.increments(); | |
5 | - table.string('nombre'); | |
6 | - table.boolean('desactivado'); | |
7 | - }) | |
8 | - ]); | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.createTable('cobrador', function(table) { | |
3 | + table.increments(); | |
4 | + table.string('nombre'); | |
5 | + table.boolean('desactivado'); | |
6 | + }); | |
9 | 7 | }; |
10 | 8 | |
11 | -exports.down = function(knex, Promise) { | |
12 | - return Promise.all([ | |
13 | - knex.schema.dropTable('cobrador') | |
14 | - ]); | |
9 | +exports.down = function(knex) { | |
10 | + return knex.schema.dropTable('cobrador'); | |
15 | 11 | }; |
migrations/20181206105940_v0.1.2.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.createTable('remito-plazo', function(table) { | |
4 | - table.increments(); | |
5 | - table.integer('dias').unsigned(); | |
6 | - table.bigInteger('idRemito').unsigned(); | |
7 | - }) | |
8 | - ]); | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.createTable('remito-plazo', function(table) { | |
3 | + table.increments(); | |
4 | + table.integer('dias').unsigned(); | |
5 | + table.bigInteger('idRemito').unsigned(); | |
6 | + }); | |
9 | 7 | }; |
10 | 8 | |
11 | -exports.down = function(knex, Promise) { | |
12 | - return Promise.all([ | |
13 | - knex.schema.dropTable('remito-plazo') | |
14 | - ]); | |
9 | +exports.down = function(knex) { | |
10 | + return knex.schema.dropTable('remito-plazo'); | |
15 | 11 | }; |
migrations/20181210132759_v0.4.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.table('seguimiento', function(table) { | |
4 | - table.integer('sucursal'); | |
5 | - }) | |
6 | - ]); | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.table('seguimiento', function(table) { | |
3 | + table.integer('sucursal'); | |
4 | + }); | |
7 | 5 | }; |
8 | 6 | |
9 | -exports.down = function(knex, Promise) { | |
10 | - return Promise.all([ | |
11 | - knex.schema.table('seguimiento', function(table) { | |
12 | - table.dropColumn('sucursal'); | |
13 | - }) | |
14 | - ]); | |
7 | +exports.down = function(knex) { | |
8 | + return knex.schema.table('seguimiento', function(table) { | |
9 | + table.dropColumn('sucursal'); | |
10 | + }); | |
15 | 11 | }; |
migrations/20181211152717_0.4.1.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.table('ARECIBOS', function(table) { | |
4 | - table.bigInteger('idCobrador').unsigned(); | |
5 | - }) | |
6 | - ]); | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.table('ARECIBOS', function(table) { | |
3 | + table.bigInteger('idCobrador').unsigned(); | |
4 | + }); | |
7 | 5 | |
8 | 6 | }; |
9 | 7 | |
10 | -exports.down = function(knex, Promise) { | |
11 | - return Promise.all([ | |
12 | - knex.schema.table('ARECIBOS', function(table) { | |
13 | - table.dropColumn('idCobrador'); | |
14 | - }) | |
15 | - ]); | |
8 | +exports.down = function(knex) { | |
9 | + return knex.schema.table('ARECIBOS', function(table) { | |
10 | + table.dropColumn('idCobrador'); | |
11 | + }); | |
16 | 12 | }; |
migrations/20181213153525_0.5.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema | |
5 | - .table('vehiculo', function(table) { | |
6 | - table.string('codigo'); | |
7 | - table.dropColumn('cisternado'); | |
8 | - }) | |
9 | - .createTable('cisterna', function(table) { | |
10 | - table.increments(); | |
11 | - table.string('codigo'); | |
12 | - table.decimal('capacidad', 12, 2); | |
13 | - table.bigInteger('idVehiculo').unsigned(); | |
14 | - table.bigInteger('idUnidadMedida').unsigned(); | |
15 | - table.bigInteger('idCarga').unsigned(); | |
16 | - }) | |
17 | - .createTable('cisterna_carga', function(table) { | |
18 | - table.increments(); | |
19 | - table.decimal('cantidad', 12, 2); | |
20 | - table.bigInteger('codigoArticulo').unsigned(); | |
21 | - table.bigInteger('codigoSectorArticulo').unsigned(); | |
22 | - }) | |
23 | - .createTable('cisterna_movimiento', function(table) { | |
24 | - table.increments(); | |
25 | - table.dateTime('fecha'); | |
26 | - table.decimal('cantidad', 12, 2); | |
27 | - table.string('metodo'); | |
28 | - table.bigInteger('idCisternaCarga').unsigned(); | |
29 | - }) | |
30 | - .createTable('hoja_ruta_movimiento', function(table) { | |
31 | - table.increments(); | |
32 | - table.string('reciboDescarga'); | |
33 | - table.bigInteger('idRemito').unsigned(); | |
34 | - table.bigInteger('idCisternaMovimiento').unsigned(); | |
35 | - table.bigInteger('idSeguimiento').unsigned(); | |
36 | - }) | |
37 | - .table('nota_pedido', function(table) { | |
38 | - table.bigInteger('idSeguimiento').unsigned(); | |
39 | - }) | |
40 | - .table('hoja_ruta', function(table) { | |
41 | - table.bigInteger('idSeguimiento').unsigned(); | |
42 | - }) | |
43 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema | |
4 | + .table('vehiculo', function(table) { | |
5 | + table.string('codigo'); | |
6 | + table.dropColumn('cisternado'); | |
7 | + }) | |
8 | + .createTable('cisterna', function(table) { | |
9 | + table.increments(); | |
10 | + table.string('codigo'); | |
11 | + table.decimal('capacidad', 12, 2); | |
12 | + table.bigInteger('idVehiculo').unsigned(); | |
13 | + table.bigInteger('idUnidadMedida').unsigned(); | |
14 | + table.bigInteger('idCarga').unsigned(); | |
15 | + }) | |
16 | + .createTable('cisterna_carga', function(table) { | |
17 | + table.increments(); | |
18 | + table.decimal('cantidad', 12, 2); | |
19 | + table.bigInteger('codigoArticulo').unsigned(); | |
20 | + table.bigInteger('codigoSectorArticulo').unsigned(); | |
21 | + }) | |
22 | + .createTable('cisterna_movimiento', function(table) { | |
23 | + table.increments(); | |
24 | + table.dateTime('fecha'); | |
25 | + table.decimal('cantidad', 12, 2); | |
26 | + table.string('metodo'); | |
27 | + table.bigInteger('idCisternaCarga').unsigned(); | |
28 | + }) | |
29 | + .createTable('hoja_ruta_movimiento', function(table) { | |
30 | + table.increments(); | |
31 | + table.string('reciboDescarga'); | |
32 | + table.bigInteger('idRemito').unsigned(); | |
33 | + table.bigInteger('idCisternaMovimiento').unsigned(); | |
34 | + table.bigInteger('idSeguimiento').unsigned(); | |
35 | + }) | |
36 | + .table('nota_pedido', function(table) { | |
37 | + table.bigInteger('idSeguimiento').unsigned(); | |
38 | + }) | |
39 | + .table('hoja_ruta', function(table) { | |
40 | + table.bigInteger('idSeguimiento').unsigned(); | |
41 | + }) | |
44 | 42 | }; |
45 | 43 | |
46 | -exports.down = function(knex, Promise) { | |
47 | - return Promise.all([ | |
48 | - knex.schema | |
49 | - .table('vehiculo', function(table) { | |
50 | - table.string('cisternado'); | |
51 | - table.dropColumn('codigo'); | |
52 | - }) | |
53 | - .table('nota_pedido', function(table) { | |
54 | - table.dropColumn('idSeguimiento'); | |
55 | - }) | |
56 | - .table('hoja_ruta', function(table) { | |
57 | - table.dropColumn('idSeguimiento'); | |
58 | - }) | |
59 | - .dropTable('cisterna') | |
60 | - .dropTable('cisterna_carga') | |
61 | - .dropTable('cisterna_movimiento') | |
62 | - .dropTable('hoja_ruta_movimiento') | |
63 | - | |
64 | - ]); | |
44 | +exports.down = function(knex) { | |
45 | + return knex.schema | |
46 | + .table('vehiculo', function(table) { | |
47 | + table.string('cisternado'); | |
48 | + table.dropColumn('codigo'); | |
49 | + }) | |
50 | + .table('nota_pedido', function(table) { | |
51 | + table.dropColumn('idSeguimiento'); | |
52 | + }) | |
53 | + .table('hoja_ruta', function(table) { | |
54 | + table.dropColumn('idSeguimiento'); | |
55 | + }) | |
56 | + .dropTable('cisterna') | |
57 | + .dropTable('cisterna_carga') | |
58 | + .dropTable('cisterna_movimiento') | |
59 | + .dropTable('hoja_ruta_movimiento') | |
65 | 60 | }; |
migrations/20181217131259_v0.6.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema | |
4 | - .raw("ALTER TABLE ARTICULOS ADD id INT IDENTITY(1,1)") | |
5 | - .table('cisterna_carga', function(table) { | |
6 | - table.dropColumn('codigoArticulo'); | |
7 | - table.dropColumn('codigoSectorArticulo'); | |
8 | - table.bigInteger('idProducto').unsigned(); | |
9 | - }) | |
10 | - ]); | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema | |
3 | + .raw("ALTER TABLE ARTICULOS ADD id INT IDENTITY(1,1)") | |
4 | + .table('cisterna_carga', function(table) { | |
5 | + table.dropColumn('codigoArticulo'); | |
6 | + table.dropColumn('codigoSectorArticulo'); | |
7 | + table.bigInteger('idProducto').unsigned(); | |
8 | + }) | |
11 | 9 | }; |
12 | 10 | |
13 | 11 | exports.down = function(knex, Promise) { |
14 | - return Promise.all([ | |
15 | - knex.schema | |
16 | - .table('ARTICULOS', function(table) { | |
17 | - table.dropColumn('id'); | |
18 | - }).table('cisterna_carga', function(table) { | |
19 | - table.dropColumn('idProducto'); | |
20 | - table.bigInteger('codigoArticulo').unsigned(); | |
21 | - table.bigInteger('codigoSectorArticulo').unsigned(); | |
22 | - }) | |
23 | - ]); | |
12 | + return knex.schema | |
13 | + .table('ARTICULOS', function(table) { | |
14 | + table.dropColumn('id'); | |
15 | + }).table('cisterna_carga', function(table) { | |
16 | + table.dropColumn('idProducto'); | |
17 | + table.bigInteger('codigoArticulo').unsigned(); | |
18 | + table.bigInteger('codigoSectorArticulo').unsigned(); | |
19 | + }); | |
24 | 20 | }; |
migrations/20181217172010_v0.5.1.js
1 | 1 | exports.up = function(knex, Promise) { |
2 | - return Promise.all([ | |
3 | - knex.schema.table('cisterna', function(table) { | |
4 | - table.boolean('desactivado'); | |
5 | - }) | |
6 | - ]) | |
2 | + return knex.schema.table('cisterna', function(table) { | |
3 | + table.boolean('desactivado'); | |
4 | + }); | |
7 | 5 | }; |
8 | 6 | |
9 | 7 | exports.down = function(knex, Promise) { |
10 | - return Promise.all([ | |
11 | - knex.schema.table('cisterna', function(table) { | |
12 | - table.dropColumn('desactivado'); | |
13 | - }) | |
14 | - ]) | |
8 | + return knex.schema.table('cisterna', function(table) { | |
9 | + table.dropColumn('desactivado'); | |
10 | + }); | |
15 | 11 | }; |
migrations/20181218155954_0.6.1.js
1 | 1 | exports.up = function(knex, Promise) { |
2 | - return Promise.all([ | |
3 | - knex.schema | |
4 | - .raw("ALTER TABLE ARECIBOS ADD id INT IDENTITY(1,1)") | |
5 | - .table('ARECIBOS', function(table) { | |
6 | - table.bigInteger('idSeguimiento').unsigned(); | |
7 | - }) | |
8 | - ]); | |
2 | + return knex.schema | |
3 | + .raw("ALTER TABLE ARECIBOS ADD id INT IDENTITY(1,1)") | |
4 | + .table('ARECIBOS', function(table) { | |
5 | + table.bigInteger('idSeguimiento').unsigned(); | |
6 | + }); | |
9 | 7 | }; |
10 | 8 | |
11 | 9 | exports.down = function(knex, Promise) { |
12 | - return Promise.all([ | |
13 | - knex.schema | |
14 | - .table('ARECIBOS', function(table) { | |
15 | - table.dropColumn('id'); | |
16 | - table.dropColumn('idSeguimiento'); | |
17 | - }) | |
18 | - ]); | |
10 | + return knex.schema | |
11 | + .table('ARECIBOS', function(table) { | |
12 | + table.dropColumn('id'); | |
13 | + table.dropColumn('idSeguimiento'); | |
14 | + }); | |
19 | 15 | }; |
migrations/20181221125659_0.6.2.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.table('precios_condiciones', function(table) { | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema | |
4 | + .table('precios_condiciones', function(table) { | |
5 | 5 | table.dropColumn('idListaPrecio') |
6 | - }).raw("ALTER TABLE precios_condiciones ADD idListaPrecio char(4)") | |
7 | - ]) | |
6 | + }) | |
7 | + .raw("ALTER TABLE precios_condiciones ADD idListaPrecio char(4)"); | |
8 | + | |
8 | 9 | }; |
9 | 10 | |
10 | -exports.down = function(knex, Promise) { | |
11 | - return Promise.all([ | |
12 | - knex.schema.table('precios_condiciones', function(table) { | |
13 | - table.dropColumn('idListaPrecio') | |
14 | - }) | |
15 | - ]); | |
11 | +exports.down = function(knex) { | |
12 | + return knex.schema.table('precios_condiciones', function(table) { | |
13 | + table.dropColumn('idListaPrecio') | |
14 | + }); | |
16 | 15 | }; |
migrations/20181221173513_v0.6.3.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.table('articulo_nota_pedido', function(table) { | |
4 | - table.bigint('idArticulo').unsigned(); | |
5 | - }) | |
6 | - ]) | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.table('articulo_nota_pedido', function(table) { | |
3 | + table.bigint('idArticulo').unsigned(); | |
4 | + }); | |
7 | 5 | }; |
8 | 6 | |
9 | -exports.down = function(knex, Promise) { | |
10 | - return Promise.all([ | |
11 | - knex.schema.table('articulo_nota_pedido', function(table) { | |
12 | - table.dropColumn('idArticulo'); | |
13 | - }) | |
14 | - ]) | |
7 | +exports.down = function(knex) { | |
8 | + return knex.schema.table('articulo_nota_pedido', function(table) { | |
9 | + table.dropColumn('idArticulo'); | |
10 | + }); | |
15 | 11 | }; |
migrations/20181226120323_v0.6.4.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.table('articulo_remito', function(table) { | |
4 | - table.bigint('idArticulo').unsigned(); | |
5 | - }) | |
6 | - ]) | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.table('articulo_remito', function(table) { | |
3 | + table.bigint('idArticulo').unsigned(); | |
4 | + }); | |
7 | 5 | }; |
8 | 6 | |
9 | -exports.down = function(knex, Promise) { | |
10 | - return Promise.all([ | |
11 | - knex.schema.table('articulo_remito', function(table) { | |
12 | - table.dropColumn('idArticulo'); | |
13 | - }) | |
14 | - ]) | |
7 | +exports.down = function(knex) { | |
8 | + return knex.schema.table('articulo_remito', function(table) { | |
9 | + table.dropColumn('idArticulo'); | |
10 | + }); | |
15 | 11 | }; |
migrations/20181227171744_v0.6.5.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema | |
4 | - .table('cisterna_movimiento', function(table) { | |
5 | - table.bigint('idRemito').unsigned(); | |
6 | - }).table('remito', function(table) { | |
7 | - table.bigint('idUsuarioProceso').unsigned(); | |
8 | - }).table('vehiculo', function(table) { | |
9 | - table.bigint('idUsuarioProceso').unsigned(); | |
10 | - }) | |
11 | - ]) | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema | |
3 | + .table('cisterna_movimiento', function(table) { | |
4 | + table.bigint('idRemito').unsigned(); | |
5 | + }).table('remito', function(table) { | |
6 | + table.bigint('idUsuarioProceso').unsigned(); | |
7 | + }).table('vehiculo', function(table) { | |
8 | + table.bigint('idUsuarioProceso').unsigned(); | |
9 | + }); | |
12 | 10 | }; |
13 | 11 | |
14 | -exports.down = function(knex, Promise) { | |
15 | - return Promise.all([ | |
16 | - knex.schema | |
17 | - .table('cisterna_movimiento', function(table) { | |
18 | - table.dropColumn('idRemito'); | |
19 | - }).table('remito', function(table) { | |
20 | - table.dropColumn('idUsuarioProceso'); | |
21 | - }).table('vehiculo', function(table) { | |
22 | - table.dropColumn('idUsuarioProceso'); | |
23 | - }) | |
24 | - ]) | |
12 | +exports.down = function(knex) { | |
13 | + return knex.schema | |
14 | + .table('cisterna_movimiento', function(table) { | |
15 | + table.dropColumn('idRemito'); | |
16 | + }).table('remito', function(table) { | |
17 | + table.dropColumn('idUsuarioProceso'); | |
18 | + }).table('vehiculo', function(table) { | |
19 | + table.dropColumn('idUsuarioProceso'); | |
20 | + }); | |
25 | 21 | }; |
migrations/20181231114424_v0.6.6.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema | |
5 | - .createTable('a_punto_descarga', function(table) { | |
6 | - table.increments(); | |
7 | - table.bigInteger('id_cliente'); | |
8 | - table.bigInteger('id_da_config_0'); | |
9 | - table.string('descripcion'); | |
10 | - table.string('latitud'); | |
11 | - table.string('longitud'); | |
12 | - table.boolean('desactivado'); | |
13 | - }) | |
14 | - .table('CLIENTES', function(table) { | |
15 | - table.boolean('ES_PROS'); | |
16 | - }) | |
17 | - .createTable('nota_pedido_punto_descarga', function(table) { | |
18 | - table.increments(); | |
19 | - table.bigInteger('idPuntoDescarga').unsigned(); | |
20 | - table.bigInteger('idNotaPedido').unsigned(); | |
21 | - table.bigInteger('idProducto').unsigned(); | |
22 | - table.decimal('cantidad', 12, 2); | |
23 | - }) | |
24 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema | |
4 | + .createTable('a_punto_descarga', function(table) { | |
5 | + table.increments(); | |
6 | + table.bigInteger('id_cliente'); | |
7 | + table.bigInteger('id_da_config_0'); | |
8 | + table.string('descripcion'); | |
9 | + table.string('latitud'); | |
10 | + table.string('longitud'); | |
11 | + table.boolean('desactivado'); | |
12 | + }) | |
13 | + .table('CLIENTES', function(table) { | |
14 | + table.boolean('ES_PROS'); | |
15 | + }) | |
16 | + .createTable('nota_pedido_punto_descarga', function(table) { | |
17 | + table.increments(); | |
18 | + table.bigInteger('idPuntoDescarga').unsigned(); | |
19 | + table.bigInteger('idNotaPedido').unsigned(); | |
20 | + table.bigInteger('idProducto').unsigned(); | |
21 | + table.decimal('cantidad', 12, 2); | |
22 | + }); | |
25 | 23 | }; |
26 | 24 | |
27 | -exports.down = function(knex, Promise) { | |
28 | - return Promise.all([ | |
29 | - knex.schema | |
30 | - .dropTable('a_punto_descarga') | |
31 | - .table('CLIENTES', function(table) { | |
32 | - table.dropColumn('ES_PROS'); | |
33 | - }) | |
34 | - .dropTable('nota_pedido_punto_descarga') | |
35 | - ]); | |
25 | +exports.down = function(knex) { | |
26 | + return knex.schema | |
27 | + .dropTable('a_punto_descarga') | |
28 | + .table('CLIENTES', function(table) { | |
29 | + table.dropColumn('ES_PROS'); | |
30 | + }) | |
31 | + .dropTable('nota_pedido_punto_descarga'); | |
36 | 32 | }; |
migrations/20190102160859_v0.6.7.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.table('cisterna_movimiento', function(table) { | |
4 | - table.boolean('anulado'); | |
5 | - }) | |
6 | - ]) | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.table('cisterna_movimiento', function(table) { | |
3 | + table.boolean('anulado'); | |
4 | + }); | |
7 | 5 | }; |
8 | 6 | |
9 | -exports.down = function(knex, Promise) { | |
10 | - return Promise.all([ | |
11 | - knex.schema.table('cisterna_movimiento', function(table) { | |
12 | - table.dropColumn('anulado'); | |
13 | - }) | |
14 | - ]) | |
7 | +exports.down = function(knex) { | |
8 | + return knex.schema.table('cisterna_movimiento', function(table) { | |
9 | + table.dropColumn('anulado'); | |
10 | + }); | |
15 | 11 | }; |
migrations/20190107163621_v0.6.8.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.table('VENDEDORES', function(table) { | |
5 | - table.boolean('ES_COBRADOR'); | |
6 | - }) | |
7 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.table('VENDEDORES', function(table) { | |
4 | + table.boolean('ES_COBRADOR'); | |
5 | + }); | |
8 | 6 | }; |
9 | 7 | |
10 | -exports.down = function(knex, Promise) { | |
11 | - return Promise.all([ | |
12 | - knex.schema.table('VENDEDORES', function(table) { | |
13 | - table.dropColumn('ES_COBRADOR'); | |
14 | - }) | |
15 | - ]); | |
8 | +exports.down = function(knex) { | |
9 | + return knex.schema.table('VENDEDORES', function(table) { | |
10 | + table.dropColumn('ES_COBRADOR'); | |
11 | + }); | |
16 | 12 | }; |
migrations/20190108114746_v0.6.9.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema | |
4 | - .table('cisterna', function(table) { | |
5 | - table.dropColumn('idCarga'); | |
6 | - }) | |
7 | - .table('cisterna_carga', function(table) { | |
8 | - table.bigInteger('idCisterna').unsigned(); | |
9 | - table.date('fechaReparto'); | |
10 | - }) | |
11 | - ]) | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema | |
3 | + .table('cisterna', function(table) { | |
4 | + table.dropColumn('idCarga'); | |
5 | + }) | |
6 | + .table('cisterna_carga', function(table) { | |
7 | + table.bigInteger('idCisterna').unsigned(); | |
8 | + table.date('fechaReparto'); | |
9 | + }); | |
12 | 10 | }; |
13 | 11 | |
14 | -exports.down = function(knex, Promise) { | |
15 | - return Promise.all([ | |
16 | - knex.schema | |
17 | - .table('cisterna', function(table) { | |
18 | - table.bigInteger('idCarga'); | |
19 | - }) | |
20 | - .table('cisterna_carga', function(table) { | |
21 | - table | |
22 | - .dropColumn('idCisterna') | |
23 | - .dropColumn('fechaReparto'); | |
24 | - }) | |
25 | - ]) | |
12 | +exports.down = function(knex) { | |
13 | + return knex.schema | |
14 | + .table('cisterna', function(table) { | |
15 | + table.bigInteger('idCarga'); | |
16 | + }) | |
17 | + .table('cisterna_carga', function(table) { | |
18 | + table | |
19 | + .dropColumn('idCisterna') | |
20 | + .dropColumn('fechaReparto'); | |
21 | + }); | |
26 | 22 | }; |
migrations/20190109123406_v0.6.10.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.table('VENDEDORES', function(table) { | |
5 | - table.boolean('desactivado'); | |
6 | - }) | |
7 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.table('VENDEDORES', function(table) { | |
4 | + table.boolean('desactivado'); | |
5 | + }); | |
8 | 6 | }; |
9 | 7 | |
10 | -exports.down = function(knex, Promise) { | |
11 | - return Promise.all([ | |
12 | - knex.schema.table('VENDEDORES', function(table) { | |
13 | - table.dropColumn('desactivado'); | |
14 | - }) | |
15 | - ]); | |
8 | +exports.down = function(knex) { | |
9 | + return knex.schema.table('VENDEDORES', function(table) { | |
10 | + table.dropColumn('desactivado'); | |
11 | + }); | |
16 | 12 | }; |
migrations/20190109123752_v0.6.11.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.createTable('login', function(table) { | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema | |
4 | + .createTable('login', function(table) { | |
5 | 5 | table.increments(); |
6 | 6 | table.string('username'); |
7 | 7 | table.string('password'); |
... | ... | @@ -10,19 +10,16 @@ exports.up = function(knex, Promise) { |
10 | 10 | table.bigInteger('idLogin').unsigned(); |
11 | 11 | }).table('chofer', function(table) { |
12 | 12 | table.bigInteger('idLogin').unsigned(); |
13 | - }) | |
14 | - ]); | |
13 | + }); | |
15 | 14 | }; |
16 | 15 | |
17 | -exports.down = function(knex, Promise) { | |
18 | - return Promise.all([ | |
19 | - knex.schema | |
20 | - .dropTable('login') | |
21 | - .table('vendedores', function(table) { | |
22 | - table.dropColumn('idLogin'); | |
23 | - }) | |
24 | - .table('chofer', function(table) { | |
25 | - table.dropColumn('idLogin'); | |
26 | - }) | |
27 | - ]); | |
16 | +exports.down = function(knex) { | |
17 | + return knex.schema | |
18 | + .dropTable('login') | |
19 | + .table('vendedores', function(table) { | |
20 | + table.dropColumn('idLogin'); | |
21 | + }) | |
22 | + .table('chofer', function(table) { | |
23 | + table.dropColumn('idLogin'); | |
24 | + }); | |
28 | 25 | }; |
migrations/20190110100715_v0.6.12.js
1 | 1 | exports.up = function(knex, Promise) { |
2 | - return Promise.all([ | |
3 | - knex.schema | |
4 | - .table('vehiculo', function(table) { | |
5 | - table.dropColumn('idUsuarioProceso'); | |
6 | - }) | |
7 | - .table('cisterna_carga', function(table) { | |
8 | - table.bigInteger('idUsuarioProceso'); | |
9 | - table.boolean('confirmado'); | |
10 | - }) | |
11 | - ]) | |
2 | + return knex.schema | |
3 | + .table('vehiculo', function(table) { | |
4 | + table.dropColumn('idUsuarioProceso'); | |
5 | + }) | |
6 | + .table('cisterna_carga', function(table) { | |
7 | + table.bigInteger('idUsuarioProceso'); | |
8 | + table.boolean('confirmado'); | |
9 | + }); | |
12 | 10 | }; |
13 | 11 | |
14 | 12 | exports.down = function(knex, Promise) { |
15 | - return Promise.all([ | |
16 | - knex.schema | |
17 | - .table('vehiculo', function(table) { | |
18 | - table.bigint('idUsuarioProceso').unsigned(); | |
19 | - }) | |
20 | - .table('cisterna_carga', function(table) { | |
21 | - table.dropColumns('idUsuarioProceso', 'confirmado'); | |
22 | - }) | |
23 | - ]) | |
13 | + return knex.schema | |
14 | + .table('vehiculo', function(table) { | |
15 | + table.bigint('idUsuarioProceso').unsigned(); | |
16 | + }) | |
17 | + .table('cisterna_carga', function(table) { | |
18 | + table.dropColumns('idUsuarioProceso', 'confirmado'); | |
19 | + }); | |
24 | 20 | }; |
migrations/20190110152626_v0.6.13.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.table('login', function(table) { | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema | |
3 | + .table('login', function(table) { | |
4 | 4 | table.dateTime('ultimoLogin'); |
5 | 5 | table.string('token'); |
6 | - }) | |
7 | - ]) | |
6 | + }); | |
8 | 7 | }; |
9 | 8 | |
10 | -exports.down = function(knex, Promise) { | |
11 | - return Promise.all([ | |
12 | - knex.schema.table('login', function(table) { | |
9 | +exports.down = function(knex) { | |
10 | + return knex.schema | |
11 | + .table('login', function(table) { | |
13 | 12 | table.dropColumns('ultimoLogin', 'token'); |
14 | - }) | |
15 | - ]); | |
13 | + }); | |
16 | 14 | }; |
migrations/20190114160629_v0.6.14.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.table('hoja_ruta', function(table) { | |
5 | - //0=disponible 1=asignado 2=terminado | |
6 | - table.integer('estado').unsigned(); | |
7 | - table.date('fechaReparto'); | |
8 | - }) | |
9 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.table('hoja_ruta', function(table) { | |
4 | + //0=disponible 1=asignado 2=terminado | |
5 | + table.integer('estado').unsigned(); | |
6 | + table.date('fechaReparto'); | |
7 | + }); | |
10 | 8 | }; |
11 | 9 | |
12 | -exports.down = function(knex, Promise) { | |
13 | - return Promise.all([ | |
14 | - knex.schema.table('hoja_ruta', function(table) { | |
15 | - table.dropColumn('estado'); | |
16 | - table.dropColumn('fechaReparto'); | |
17 | - }) | |
18 | - ]); | |
10 | +exports.down = function(knex) { | |
11 | + return knex.schema.table('hoja_ruta', function(table) { | |
12 | + table.dropColumn('estado'); | |
13 | + table.dropColumn('fechaReparto'); | |
14 | + }) | |
19 | 15 | }; |
migrations/20190118161051_v0.6.15.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.createTable('tipo_documento', function(table) { | |
5 | - table.integer('id').unsigned().primary(); | |
6 | - table.string('descripcion'); | |
7 | - table.string('orden'); | |
8 | - table.boolean('activo'); | |
9 | - }) | |
10 | - ]) | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.createTable('tipo_documento', function(table) { | |
4 | + table.integer('id').unsigned().primary(); | |
5 | + table.string('descripcion'); | |
6 | + table.string('orden'); | |
7 | + table.boolean('activo'); | |
8 | + }); | |
11 | 9 | }; |
12 | 10 | |
13 | 11 | exports.down = function(knex, Promise) { |
14 | - return Promise.all([ | |
15 | - knex.schema.dropTable('tipo_documento') | |
16 | - ]); | |
12 | + return knex.schema.dropTable('tipo_documento'); | |
17 | 13 | }; |
migrations/20190121125737_v0.6.16.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema | |
4 | - .table('articulo_remito', function(table) { | |
5 | - table.integer('cantidadDescargada'); | |
6 | - }).table('remito', function(table) { | |
7 | - table.boolean('rechazado'); | |
8 | - table.string('motivoRechazo'); | |
9 | - }) | |
10 | - ]) | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema | |
3 | + .table('articulo_remito', function(table) { | |
4 | + table.integer('cantidadDescargada'); | |
5 | + }).table('remito', function(table) { | |
6 | + table.boolean('rechazado'); | |
7 | + table.string('motivoRechazo'); | |
8 | + }); | |
11 | 9 | }; |
12 | 10 | |
13 | -exports.down = function(knex, Promise) { | |
14 | - return Promise.all([ | |
15 | - knex.schema | |
16 | - .table('articulo_remito', function(table) { | |
17 | - table.dropColumn('cantidadDescargada'); | |
18 | - }).table('remito', function(table) { | |
19 | - table.dropColumns('rechazado', 'motivoRechazo'); | |
20 | - }) | |
21 | - ]) | |
11 | +exports.down = function(knex) { | |
12 | + return knex.schema | |
13 | + .table('articulo_remito', function(table) { | |
14 | + table.dropColumn('cantidadDescargada'); | |
15 | + }).table('remito', function(table) { | |
16 | + table.dropColumns('rechazado', 'motivoRechazo'); | |
17 | + }); | |
22 | 18 | }; |
migrations/20190122165422_v0.6.17.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.table('hoja_ruta', function(table) { | |
4 | - table.decimal('kmInicialVehiculo', 18, 4); | |
5 | - table.decimal('kmFinalVehiculo', 18, 4) | |
6 | - table.decimal('aforadorInicialVehiculo', 18, 4); | |
7 | - table.decimal('aforadorFinalVehiculo', 18, 4) | |
8 | - table.decimal('cantidadDescargaPorGravedad', 18, 4); | |
9 | - table.decimal('litrosDescargadosPorGravedad', 18, 4); | |
10 | - table.decimal('litrosCombustibleParaMovilidad', 18, 4); | |
11 | - table.string('precintoBocaUno'); | |
12 | - table.string('precintoBocaDos'); | |
13 | - table.string('precintoBocaTres'); | |
14 | - }) | |
15 | - ]); | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.table('hoja_ruta', function(table) { | |
3 | + table.decimal('kmInicialVehiculo', 18, 4); | |
4 | + table.decimal('kmFinalVehiculo', 18, 4) | |
5 | + table.decimal('aforadorInicialVehiculo', 18, 4); | |
6 | + table.decimal('aforadorFinalVehiculo', 18, 4) | |
7 | + table.decimal('cantidadDescargaPorGravedad', 18, 4); | |
8 | + table.decimal('litrosDescargadosPorGravedad', 18, 4); | |
9 | + table.decimal('litrosCombustibleParaMovilidad', 18, 4); | |
10 | + table.string('precintoBocaUno'); | |
11 | + table.string('precintoBocaDos'); | |
12 | + table.string('precintoBocaTres'); | |
13 | + }); | |
16 | 14 | }; |
17 | 15 | |
18 | -exports.down = function(knex, Promise) { | |
19 | - return Promise.all([ | |
20 | - knex.schema.table('hoja_ruta', function(table) { | |
21 | - table.dropColumns( | |
22 | - 'kmInicialVehiculo', | |
23 | - 'kmFinalVehiculo', | |
24 | - 'aforadorInicialVehiculo', | |
25 | - 'aforadorFinalVehiculo', | |
26 | - 'cantidadDescargaPorGravedad', | |
27 | - 'litrosDescargadosPorGravedad', | |
28 | - 'litrosCombustibleParaMovilidad', | |
29 | - 'precintoBocaUno', | |
30 | - 'precintoBocaDos', | |
31 | - 'precintoBocaTres' | |
32 | - ); | |
33 | - }) | |
34 | - ]); | |
16 | +exports.down = function(knex) { | |
17 | + return knex.schema.table('hoja_ruta', function(table) { | |
18 | + table.dropColumns( | |
19 | + 'kmInicialVehiculo', | |
20 | + 'kmFinalVehiculo', | |
21 | + 'aforadorInicialVehiculo', | |
22 | + 'aforadorFinalVehiculo', | |
23 | + 'cantidadDescargaPorGravedad', | |
24 | + 'litrosDescargadosPorGravedad', | |
25 | + 'litrosCombustibleParaMovilidad', | |
26 | + 'precintoBocaUno', | |
27 | + 'precintoBocaDos', | |
28 | + 'precintoBocaTres' | |
29 | + ); | |
30 | + }); | |
35 | 31 | }; |
migrations/20190125093429_v0.6.18.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.table('chofer', function(table) { | |
5 | - table.bigInteger('idTipoDocumento').unsigned(); | |
6 | - }) | |
7 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.table('chofer', function(table) { | |
4 | + table.bigInteger('idTipoDocumento').unsigned(); | |
5 | + }); | |
8 | 6 | }; |
9 | 7 | |
10 | -exports.down = function(knex, Promise) { | |
11 | - return Promise.all([ | |
12 | - knex.schema.table('chofer', function(table) { | |
13 | - table.dropColumn('idTipoDocumento'); | |
14 | - }) | |
15 | - ]); | |
8 | +exports.down = function(knex) { | |
9 | + return knex.schema.table('chofer', function(table) { | |
10 | + table.dropColumn('idTipoDocumento'); | |
11 | + }); | |
16 | 12 | }; |
migrations/20190125102735_v0.6.19.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema | |
5 | - .table('VENDEDORES', function(table) { | |
6 | - //Puede ser 1=vendedor, 2=cobrador, 3=ambos | |
7 | - table.integer('rol'); | |
8 | - table.decimal('comisionCobrador', 12, 2); | |
9 | - }) | |
10 | - .table('CLIENTES', function(table) { | |
11 | - table.bigInteger('idCobrador').unsigned(); | |
12 | - }) | |
13 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema | |
4 | + .table('VENDEDORES', function(table) { | |
5 | + //Puede ser 1=vendedor, 2=cobrador, 3=ambos | |
6 | + table.integer('rol'); | |
7 | + table.decimal('comisionCobrador', 12, 2); | |
8 | + }) | |
9 | + .table('CLIENTES', function(table) { | |
10 | + table.bigInteger('idCobrador').unsigned(); | |
11 | + }); | |
14 | 12 | }; |
15 | 13 | |
16 | -exports.down = function(knex, Promise) { | |
17 | - return Promise.all([ | |
18 | - knex.schema | |
19 | - .table('VENDEDORES', function(table) { | |
20 | - table.dropColumns('rol', 'comisionCobrador'); | |
21 | - }) | |
22 | - .table('CLIENTES', function(table) { | |
23 | - table.dropColumn('idCobrador'); | |
24 | - }) | |
25 | - ]); | |
14 | +exports.down = function(knex) { | |
15 | + return knex.schema | |
16 | + .table('VENDEDORES', function(table) { | |
17 | + table.dropColumns('rol', 'comisionCobrador'); | |
18 | + }) | |
19 | + .table('CLIENTES', function(table) { | |
20 | + table.dropColumn('idCobrador'); | |
21 | + }); | |
26 | 22 | }; |
migrations/20190131161852_v0.6.20.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema | |
4 | - .raw("ALTER TABLE ADETREC ADD id INT IDENTITY(1,1)") | |
5 | - .table('ADETREC', function(table) { | |
6 | - table.bigInteger('idArecibos'); | |
7 | - }) | |
8 | - ]); | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema | |
3 | + .raw("ALTER TABLE ADETREC ADD id INT IDENTITY(1,1)") | |
4 | + .table('ADETREC', function(table) { | |
5 | + table.bigInteger('idArecibos'); | |
6 | + }); | |
9 | 7 | }; |
10 | 8 | |
11 | -exports.down = function(knex, Promise) { | |
12 | - return Promise.all([ | |
13 | - knex.schema | |
14 | - .table('ADETREC', function(table) { | |
15 | - table.dropColumns('id', 'idArecibos'); | |
16 | - }) | |
17 | - ]); | |
9 | +exports.down = function(knex) { | |
10 | + return knex.schema | |
11 | + .table('ADETREC', function(table) { | |
12 | + table.dropColumns('id', 'idArecibos'); | |
13 | + }); | |
18 | 14 | }; |
migrations/20190207113109_v0.7.0.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.raw('UPDATE VENDEDORES SET desactivado = 0, rol = 1') | |
4 | - ]); | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.raw('UPDATE VENDEDORES SET desactivado = 0, rol = 1'); | |
5 | 3 | }; |
6 | 4 | |
7 | -exports.down = function(knex, Promise) { | |
8 | - return Promise.all([ | |
9 | - knex.schema.raw('UPDATE VENDEDORES SET desactivado = null, rol = null') | |
10 | - ]); | |
5 | +exports.down = function(knex) { | |
6 | + return knex.schema.raw('UPDATE VENDEDORES SET desactivado = null, rol = null'); | |
11 | 7 | }; |
migrations/20190208131322_0.7.1.js
migrations/20190212103514_v0.7.2.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.table('seguimiento', function(table) { | |
5 | - //KM RECORRIDOS DESDE EL PUNTO ANTERIOR O DESDE LA EMPRESA | |
6 | - table.decimal('kmRecorridos', 18, 4); | |
7 | - }) | |
8 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.table('seguimiento', function(table) { | |
4 | + //KM RECORRIDOS DESDE EL PUNTO ANTERIOR O DESDE LA EMPRESA | |
5 | + table.decimal('kmRecorridos', 18, 4); | |
6 | + }); | |
9 | 7 | }; |
10 | 8 | |
11 | -exports.down = function(knex, Promise) { | |
12 | - return Promise.all([ | |
13 | - knex.schema.table('seguimiento', function(table) { | |
14 | - table.dropColumn('kmRecorridos'); | |
15 | - }) | |
16 | - ]); | |
9 | +exports.down = function(knex) { | |
10 | + return knex.schema.table('seguimiento', function(table) { | |
11 | + table.dropColumn('kmRecorridos'); | |
12 | + }); | |
17 | 13 | }; |
migrations/20190215123700_v0.7.3.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema | |
5 | - .table('nota_pedido', function(table) { | |
6 | - table.string('observaciones'); | |
7 | - }) | |
8 | - .table('remito', function(table) { | |
9 | - table.string('observaciones'); | |
10 | - }) | |
11 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema | |
4 | + .table('nota_pedido', function(table) { | |
5 | + table.string('observaciones'); | |
6 | + }) | |
7 | + .table('remito', function(table) { | |
8 | + table.string('observaciones'); | |
9 | + }); | |
12 | 10 | }; |
13 | 11 | |
14 | -exports.down = function(knex, Promise) { | |
15 | - return Promise.all([ | |
16 | - knex.schema | |
17 | - .table('nota_pedido', function(table) { | |
18 | - table.dropColumn('observaciones'); | |
19 | - }) | |
20 | - .table('remito', function(table) { | |
21 | - table.dropColumn('observaciones'); | |
22 | - }) | |
23 | - ]); | |
12 | +exports.down = function(knex) { | |
13 | + return knex.schema | |
14 | + .table('nota_pedido', function(table) { | |
15 | + table.dropColumn('observaciones'); | |
16 | + }) | |
17 | + .table('remito', function(table) { | |
18 | + table.dropColumn('observaciones'); | |
19 | + }); | |
24 | 20 | }; |
migrations/20190220100315_v0.7.4.js
1 | -exports.up = function(knex, Promise) { | |
2 | - return Promise.all([ | |
3 | - knex.schema.raw( | |
1 | +exports.up = function(knex) { | |
2 | + return knex.schema.raw( | |
4 | 3 | "if not exists (SELECT * FROM dbo.sysobjects where id = object_id("+ |
5 | 4 | "N'dbo.[ACOBYPAG_VENCIMIENTOS]') and OBJECTPROPERTY(id, N'IsTable') = 1) begin "+ |
6 | 5 | "CREATE TABLE ACOBYPAG_VENCIMIENTOS(" + |
... | ... | @@ -129,14 +128,12 @@ exports.up = function(knex, Promise) { |
129 | 128 | "INNER JOIN ACOBYPAG B ON A.CYV = B.CYV AND A.TIP=B.TIP AND A.TCO=B.TCO AND A.SUC=B.SUC AND A.NCO=B.NCO " + |
130 | 129 | "INNER JOIN AMAEFACT C ON A.CYV = C.CYV AND A.TIP=C.TIP AND A.TCO=C.TCO AND A.SUC=C.SUC AND A.NCO=C.NCO" + |
131 | 130 | " ')" |
132 | - ) | |
133 | - ]) | |
131 | + ); | |
134 | 132 | }; |
135 | 133 | |
136 | -exports.down = function(knex, Promise) { | |
137 | - return Promise.all([ | |
138 | - knex.schema.dropTable('ACOBYPAG_VENCIMIENTOS') | |
139 | - .raw("DROP VIEW [VI_ACOBYPAG_AMAEFACT]") | |
140 | - .raw("DROP VIEW [VI_ACOBYPAG_VENCIMIENTOS]") | |
141 | - ]) | |
134 | +exports.down = function(knex) { | |
135 | + return knex.schema | |
136 | + .dropTable('ACOBYPAG_VENCIMIENTOS') | |
137 | + .raw("DROP VIEW [VI_ACOBYPAG_AMAEFACT]") | |
138 | + .raw("DROP VIEW [VI_ACOBYPAG_VENCIMIENTOS]"); | |
142 | 139 | }; |
migrations/20190220121752_v0.7.5.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.createTable('adetrec_observaciones', function(table) { | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.createTable('adetrec_observaciones', function(table) { | |
5 | 4 | table.increments(); |
6 | 5 | table.string('observacion'); |
7 | 6 | table.bigInteger('idAdetrec').unsigned(); |
8 | - }) | |
9 | - ]); | |
7 | + }); | |
10 | 8 | }; |
11 | 9 | |
12 | -exports.down = function(knex, Promise) { | |
13 | - return Promise.all([ | |
14 | - knex.schema | |
15 | - .dropTable('adetrec_observaciones') | |
16 | - ]); | |
10 | +exports.down = function(knex) { | |
11 | + return knex.schema.dropTable('adetrec_observaciones'); | |
17 | 12 | }; |
migrations/20190221092657_v0.7.6.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema | |
5 | - .table('seguimiento', function(table) { | |
6 | - table.bigInteger('idVisita').unsigned(); | |
7 | - }) | |
8 | - .createTable('visita', function(table) { | |
9 | - table.increments(); | |
10 | - table.bigInteger('idCliente').unsigned(); | |
11 | - table.bigInteger('idVisitante').unsigned(); | |
12 | - }) | |
13 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema | |
4 | + .table('seguimiento', function(table) { | |
5 | + table.bigInteger('idVisita').unsigned(); | |
6 | + }) | |
7 | + .createTable('visita', function(table) { | |
8 | + table.increments(); | |
9 | + table.bigInteger('idCliente').unsigned(); | |
10 | + table.bigInteger('idVisitante').unsigned(); | |
11 | + }); | |
14 | 12 | }; |
15 | 13 | |
16 | -exports.down = function(knex, Promise) { | |
17 | - return Promise.all([ | |
18 | - knex.schema | |
19 | - .table('seguimiento', function(table) { | |
20 | - table.dropColumn('idVisita'); | |
21 | - }) | |
22 | - .dropTable('visita') | |
23 | - ]); | |
14 | +exports.down = function(knex) { | |
15 | + return knex.schema | |
16 | + .table('seguimiento', function(table) { | |
17 | + table.dropColumn('idVisita'); | |
18 | + }) | |
19 | + .dropTable('visita'); | |
24 | 20 | }; |
migrations/20190225143232_v0.7.7.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
2 | +exports.up = function(knex) { | |
3 | 3 | return knex.schema |
4 | 4 | .table('seguimiento', function(table) { |
5 | 5 | table.dropColumn('idUsuario'); |
6 | 6 | }); |
7 | 7 | }; |
8 | 8 | |
9 | -exports.down = function(knex, Promise) { | |
9 | +exports.down = function(knex) { | |
10 | 10 | return knex.schema |
11 | 11 | .table('seguimiento', function(table) { |
12 | 12 | table.bigInteger('idUsuario').unsigned(); |
migrations/20190228111345_v0.7.8.js
... | ... | @@ -34,6 +34,8 @@ exports.up = function(knex, Promise) { |
34 | 34 | }; |
35 | 35 | |
36 | 36 | exports.down = function(knex, Promise) { |
37 | + | |
38 | + //PARA HACER FUNCIONAR ESTE ROLLBACK HAY QUE ELIMINAR MANUALMENTE LAS COLUMNAS | |
37 | 39 | return knex.schema |
38 | 40 | .table('articulo_nota_pedido', function(table) { |
39 | 41 | table.dropColumns('netoUnitario', 'costoUnitario', 'exentoUnitario', |
migrations/20190311170816_v0.8.0.js
1 | 1 | const md5 = require('md5'); |
2 | 2 | |
3 | -exports.up = function(knex, Promise) { | |
3 | +exports.up = function(knex) { | |
4 | 4 | |
5 | 5 | return knex.schema |
6 | 6 | .table('APAREMP', function(table) { |
7 | 7 | |
8 | 8 | table.string('idEmpresa'); |
9 | 9 | }).then(function() { |
10 | - return Promise.all([ | |
11 | - knex('APAREMP').update({ idEmpresa: md5(new Date().getTime())}) | |
12 | - ]); | |
10 | + return knex('APAREMP').update({ idEmpresa: md5(new Date().getTime())}); | |
13 | 11 | }); |
14 | 12 | |
15 | 13 | }; |
16 | 14 | |
17 | -exports.down = function(knex, Promise) { | |
18 | - return Promise.all([ | |
19 | - knex.schema.table('APAREMP', function(table) { | |
20 | - table.dropColumn('idEmpresa'); | |
21 | - }) | |
22 | - ]); | |
15 | +exports.down = function(knex) { | |
16 | + return knex.schema.table('APAREMP', function(table) { | |
17 | + table.dropColumn('idEmpresa'); | |
18 | + }); | |
23 | 19 | }; |
migrations/20190412094131_v0.9.0.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema | |
5 | - .createTable('remito_punto_descarga', function(table) { | |
6 | - table.increments(); | |
7 | - table.bigInteger('idPuntoDescarga').unsigned(); | |
8 | - table.bigInteger('idRemito').unsigned(); | |
9 | - }) | |
10 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema | |
4 | + .createTable('remito_punto_descarga', function(table) { | |
5 | + table.increments(); | |
6 | + table.bigInteger('idPuntoDescarga').unsigned(); | |
7 | + table.bigInteger('idRemito').unsigned(); | |
8 | + }); | |
11 | 9 | }; |
12 | 10 | |
13 | -exports.down = function(knex, Promise) { | |
14 | - return Promise.all([ | |
15 | - knex.schema | |
16 | - .dropTable('remito_punto_descarga') | |
17 | - ]); | |
11 | +exports.down = function(knex) { | |
12 | + return knex.schema.dropTable('remito_punto_descarga'); | |
18 | 13 | }; |
migrations/20190425163004_v0.9.1.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema.createTable('parametros', function(table) { | |
5 | - table.increments(); | |
6 | - table.string('modulo'); | |
7 | - table.string('jsonText', [4000]); | |
8 | - table.string('jsonText2', [4000]); | |
9 | - }) | |
10 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema.createTable('parametros', function(table) { | |
4 | + table.increments(); | |
5 | + table.string('modulo'); | |
6 | + table.string('jsonText', [4000]); | |
7 | + table.string('jsonText2', [4000]); | |
8 | + }); | |
11 | 9 | }; |
12 | 10 | |
13 | -exports.down = function(knex, Promise) { | |
14 | - return Promise.all([ | |
15 | - knex.schema.dropTable('parametros') | |
16 | - ]); | |
11 | +exports.down = function(knex) { | |
12 | + return knex.schema.dropTable('parametros'); | |
17 | 13 | }; |
migrations/20190524103556_v0.10.0.js
1 | 1 | |
2 | -exports.up = function (knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema | |
5 | - .table('nota_pedido', function (table) { | |
6 | - table.bigInteger('idListaPrecio').unsigned(); | |
7 | - table.dropColumn('idPrecioCondicion'); | |
8 | - }) | |
9 | - .table('plazo_pago', function (table) { | |
10 | - table.bigInteger('idCliente').unsigned(); | |
11 | - table.dropColumn('idPreciosCondiciones'); | |
2 | +exports.up = function (knex) { | |
3 | + return knex.schema | |
4 | + .table('nota_pedido', function (table) { | |
5 | + table.bigInteger('idListaPrecio').unsigned(); | |
6 | + table.dropColumn('idPrecioCondicion'); | |
7 | + }) | |
8 | + .table('plazo_pago', function (table) { | |
9 | + table.bigInteger('idCliente').unsigned(); | |
10 | + table.dropColumn('idPreciosCondiciones'); | |
12 | 11 | |
13 | - }) | |
14 | - .table('remito', function (table) { | |
15 | - table.bigInteger('idListaPrecio').unsigned(); | |
16 | - table.dropColumn('idPrecioCondicion'); | |
17 | - }) | |
18 | - ]); | |
12 | + }) | |
13 | + .table('remito', function (table) { | |
14 | + table.bigInteger('idListaPrecio').unsigned(); | |
15 | + table.dropColumn('idPrecioCondicion'); | |
16 | + }); | |
19 | 17 | }; |
20 | 18 | |
21 | 19 | exports.down = function (knex, Promise) { |
22 | - return Promise.all([ | |
23 | - knex.schema | |
24 | - .table('nota_pedido', function (table) { | |
25 | - table.dropColumn('idListaPrecio'); | |
26 | - table.bigInteger('idPrecioCondicion').unsigned(); | |
27 | - }) | |
28 | - .table('plazo_pago', function (table) { | |
29 | - table.dropColumn('idCliente'); | |
30 | - table.bigInteger('idPreciosCondiciones').unsigned(); | |
31 | - }) | |
32 | - .table('remito', function (table) { | |
33 | - table.dropColumn('idListaPrecio'); | |
34 | - table.bigInteger('idPrecioCondicion').unsigned(); | |
35 | - }) | |
36 | - ]); | |
20 | + return knex.schema | |
21 | + .table('nota_pedido', function (table) { | |
22 | + table.dropColumn('idListaPrecio'); | |
23 | + table.bigInteger('idPrecioCondicion').unsigned(); | |
24 | + }) | |
25 | + .table('plazo_pago', function (table) { | |
26 | + table.dropColumn('idCliente'); | |
27 | + table.bigInteger('idPreciosCondiciones').unsigned(); | |
28 | + }) | |
29 | + .table('remito', function (table) { | |
30 | + table.dropColumn('idListaPrecio'); | |
31 | + table.bigInteger('idPrecioCondicion').unsigned(); | |
32 | + }); | |
37 | 33 | }; |
migrations/20190611150606_v0.11.0.js
1 | 1 | |
2 | -exports.up = function(knex, Promise) { | |
3 | - return Promise.all([ | |
4 | - knex.schema | |
5 | - .table('hoja_ruta', function (table) { | |
6 | - table.bigInteger('abierta').unsigned(); | |
7 | - }) | |
8 | - ]); | |
2 | +exports.up = function(knex) { | |
3 | + return knex.schema | |
4 | + .table('hoja_ruta', function (table) { | |
5 | + table.bigInteger('abierta').unsigned(); | |
6 | + }); | |
9 | 7 | }; |
10 | 8 | |
11 | -exports.down = function(knex, Promise) { | |
12 | - return Promise.all([ | |
13 | - knex.schema | |
14 | - .table('hoja_ruta', function (table) { | |
15 | - table.dropColumn('abierta'); | |
16 | - }) | |
17 | - ]); | |
9 | +exports.down = function(knex) { | |
10 | + return knex.schema | |
11 | + .table('hoja_ruta', function (table) { | |
12 | + table.dropColumn('abierta'); | |
13 | + }); | |
18 | 14 | }; |
package.json
... | ... | @@ -4,12 +4,15 @@ |
4 | 4 | "description": "Paquetes de migraciones", |
5 | 5 | "main": "knexfile.js", |
6 | 6 | "dependencies": { |
7 | - "knex": "^0.18.2", | |
7 | + "bluebird": "^3.5.5", | |
8 | + "knex": "^0.18.3", | |
9 | + "md5": "^2.2.1", | |
8 | 10 | "mssql": "^5.1.0" |
9 | 11 | }, |
10 | 12 | "devDependencies": {}, |
11 | 13 | "scripts": { |
12 | - "test": "echo \"Error: no test specified\" && exit 1" | |
14 | + "test": "echo \"Error: no test specified\" && exit 1", | |
15 | + "init": "npm install -g knex && npm install && knex init" | |
13 | 16 | }, |
14 | 17 | "repository": { |
15 | 18 | "type": "git", |