20181217131259_v0.6.js 841 Bytes
exports.up = function(knex, Promise) {
    return Promise.all([
        knex.schema
            .raw("ALTER TABLE ARTICULOS ADD id INT IDENTITY(1,1)")
            .table('cisterna_carga', function(table) {
                table.dropColumn('codigoArticulo');
                table.dropColumn('codigoSectorArticulo');
                table.bigInteger('idProducto').unsigned();
            })
    ]);
};

exports.down = function(knex, Promise) {
    return Promise.all([
        knex.schema
            .table('ARTICULOS', function(table) {
                table.dropColumn('id');
            }).table('cisterna_carga', function(table) {
                table.dropColumn('idProducto');
                table.bigInteger('codigoArticulo').unsigned();
                table.bigInteger('codigoSectorArticulo').unsigned();
            })
    ]);
};