20190311170816_v0.8.0.js 537 Bytes
const md5 = require('md5');

exports.up = function(knex, Promise) {

    return knex.schema
        .table('APAREMP', function(table) {

            table.string('idEmpresa');
        }).then(function() {
            return Promise.all([
                knex('APAREMP').update({ idEmpresa: md5(new Date().getTime())})
            ]);
        });

};

exports.down = function(knex, Promise) {
    return Promise.all([
        knex.schema.table('APAREMP', function(table) {
            table.dropColumn('idEmpresa');
        })
    ]);
};