You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
731 B
21 lines
731 B
/**
|
|
* @param { import("knex").Knex } knex
|
|
* @returns { Promise<void> }
|
|
*/
|
|
export const up = async knex => {
|
|
return knex.schema.createTable("site_config", function (table) {
|
|
table.increments("id").primary() // 自增主键
|
|
table.string("key", 100).notNullable().unique() // 配置项key,唯一
|
|
table.text("value").notNullable() // 配置项value
|
|
table.timestamp("created_at").defaultTo(knex.fn.now()) // 创建时间
|
|
table.timestamp("updated_at").defaultTo(knex.fn.now()) // 更新时间
|
|
})
|
|
}
|
|
|
|
/**
|
|
* @param { import("knex").Knex } knex
|
|
* @returns { Promise<void> }
|
|
*/
|
|
export const down = async knex => {
|
|
return knex.schema.dropTable("site_config") // 回滚时删除表
|
|
}
|
|
|