Created
July 30, 2015 21:29
-
-
Save ashleygwilliams/767d25cf6fcada6eada6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
exports.up = function(knex, Promise) { | |
return knex.transaction(function(trx) { | |
return knex('users').transacting(trx) | |
.update('language', knex.raw("concat(users.language, '-', user.country)")) | |
.then(function() { | |
return knex.transacting(trx).raw('ALTER TABLE "users" ALTER COLUMN "language" SET DEFAULT \'en-US\''); | |
}) | |
.then(trx.commit); | |
}) | |
}; | |
exports.down = function(knex) { | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment