Commit 9cbd59585b2b0710e891b19778338ececc7dbdbf
1 parent
4e9c322c19
Exists in
master
add migration
Showing
1 changed file
with
16 additions
and
0 deletions
Show diff stats
migrations/20190710152606_v0.12.0.js
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | + | |
| 2 | +exports.up = function(knex) { | |
| 3 | + return knex.schema | |
| 4 | + .table('cisterna_carga' ,function(table) { | |
| 5 | + table.integer('orden'); | |
| 6 | + }) | |
| 7 | + .raw("update cisterna_carga set orden = 1"); | |
| 8 | +}; | |
| 9 | + | |
| 10 | +exports.down = function(knex) { | |
| 11 | + | |
| 12 | + //Para correr rollback borrar manualmente constrain | |
| 13 | + return knex.schema.table('cisterna_carga', function (table) { | |
| 14 | + table.dropColumn('orden'); | |
| 15 | + }); | |
| 16 | +}; |