alter tables with alterTable

pull/31/head
unknown 2018-11-19 15:31:44 -05:00
parent 098f8f6b11
commit 0109bfd3c0
1 changed files with 24 additions and 32 deletions

View File

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