【发布时间】:2019-06-17 08:09:17
【问题描述】:
exports.up = async function(knex) {
knex.schema.alterTable('posts', (t) => {
t.timestamps(true, true)
})
}
exports.down = async function(knex) {
knex.schema.alterTable('posts', (t) => {
t.dropTimestamps()
})
}
根据文档,这将创建一个 created_at 和 updated_at 列。
但事实并非如此。
如何使用 Knex 创建这些列。
【问题讨论】:
-
你是怎么执行的?
标签: knex.js