alter tables with alterTable
parent
098f8f6b11
commit
0109bfd3c0
|
@ -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')
|
|
||||||
})
|
})
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue