const md5 = require('md5'); exports.up = function(knex) { return knex.schema .table('APAREMP', function(table) { table.string('idEmpresa'); }).then(function() { return knex('APAREMP').update({ idEmpresa: md5(new Date().getTime())}); }); }; exports.down = function(knex) { return knex.schema.table('APAREMP', function(table) { table.dropColumn('idEmpresa'); }); };