knex requires columns be dropped before changing
parent
49c2997cda
commit
098f8f6b11
|
@ -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')
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue