Skip to content

Instantly share code, notes, and snippets.

@ashleygwilliams
Created July 29, 2015 18:07
Show Gist options
  • Save ashleygwilliams/c14b335c76854c0c094c to your computer and use it in GitHub Desktop.
Save ashleygwilliams/c14b335c76854c0c094c to your computer and use it in GitHub Desktop.
exports.up = function(knex) {
knex('users')
.update({
language: users.get('language') + '-' + users.get('country')
})
.dropColumn('country')
.column('language').defaultTo('en-US')
};
exports.down = function(knex) {
knex('users')
.addColumn('country')
.update({
country: users.language.slice(0,1),
language: users.language.slice(3,4)
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment