CREATE TRIGGER https://www.sqlite.org/lang_createtrigger.html
触发器
DROP TABLE IF EXISTS user_token;
CREATE TABLE IF NOT EXISTS user_token (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
token TEXT NULL,
"uid" INTEGER NULL,
"cid" INTEGER NULL,
"info" TEXT NULL,
created_at TEXT NOT NULL DEFAULT (DATETIME('now', 'localtime')),
updated_at TEXT NOT NULL DEFAULT (DATETIME('now', 'localtime'))
)
;
CREATE TRIGGER IF NOT EXISTS trigger_user_token_updated_at AFTER UPDATE ON user_token
BEGIN
UPDATE user_token SET updated_at = DATETIME('now', 'localtime')
WHERE rowid = NEW.rowid;
END;
翻译
搜索
复制
标签:sqlite,TEXT,CREATE,token,user,action,NULL From: https://www.cnblogs.com/papering/p/18454857