knex requires columns be dropped before changing

pull/31/head
unknown 2018-11-19 15:27:37 -05:00
parent 49c2997cda
commit 098f8f6b11
1 changed files with 8 additions and 0 deletions

View File

@ -1,18 +1,22 @@
exports.up = function (knex, Promise) {
return Promise.all([
knex.schema.table('user', t => {
t.dropColumns('created_at', 'updated_at')
t.bigInteger('created_at')
t.bigInteger('updated_at')
}),
knex.schema.table('passport', t => {
t.dropColumns('created_at', 'updated_at')
t.bigInteger('created_at')
t.bigInteger('updated_at')
}),
knex.schema.table('targeturl', t => {
t.dropColumns('created_at', 'updated_at')
t.bigInteger('created_at')
t.bigInteger('updated_at')
}),
knex.schema.table('book', t => {
t.dropColumns('created_at', 'updated_at')
t.bigInteger('created_at')
t.bigInteger('updated_at')
})
@ -22,18 +26,22 @@ exports.up = function (knex, Promise) {
exports.down = function (knex, Promise) {
return Promise.all([
knex.schema.table('user', t => {
t.dropColumns('created_at', 'updated_at')
t.integer('created_at')
t.integer('updated_at')
}),
knex.schema.table('passport', t => {
t.dropColumns('created_at', 'updated_at')
t.integer('created_at')
t.integer('updated_at')
}),
knex.schema.table('targeturl', t => {
t.dropColumns('created_at', 'updated_at')
t.integer('created_at')
t.integer('updated_at')
}),
knex.schema.table('book', t => {
t.dropColumns('created_at', 'updated_at')
t.integer('created_at')
t.integer('updated_at')
})