Created
July 29, 2015 18:07
-
-
Save ashleygwilliams/c14b335c76854c0c094c 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
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