【文件属性】:
文件名称:objection-timestamps:Objection插件可自动修改模型上的created_at和updated_at列
文件大小:49KB
文件格式:ZIP
更新时间:2021-04-02 06:17:53
TypeScript
异议时间戳记
自动修改模型上的created_at和updated_at列。
设置
基本的
基本设置假定您的表中有created_at和updated_at列。
let Model = require ( 'objection' ) . Model ;
let timestampPlugin = require ( 'objection-timestamps' ) . timestampPlugin ;
class Post extends timestampPlugin ( ) ( Model ) {
static get tableName ( ) {
return 'user' ;
}
// allow timestamp plugin on this model
static get timestamp ( ) {
【文件预览】:
objection-timestamps-master
----package.json(1KB)
----tslint.json(235B)
----test()
--------test.ts(7KB)
----src()
--------index.ts(2KB)
----.npmignore(52B)
----tsconfig.json(5KB)
----.gitignore(1KB)
----.circleci()
--------config.yml(750B)
----README.md(3KB)
----yarn.lock(100KB)