我想创建一个触发器,以便在创建记录2分钟后删除它。这将用于“恢复密码”方案,因此这些2分钟将是某人使用验证代码恢复其密码的时间窗口。我正在研究SQLite。情况如下:
CREATE TABLE IF NOT EXISTS password_recovery(
email VARCHAR(50) NOT NULL UNIQUE,
confirmation_id INTEGER(5) PRIMARY KEY,
FOREIGN KEY (email) REFERENCES users (email)
ON DELETE NO ACTION ON UPDATE NO ACTION,
);
CREATE TRIGGER IF NOT EXISTS password_recovery_deletion_timer AFTER INSERT ON password_recovery
BEGIN
DO SLEEP(120);
// i want to delete here but how do I pass which record triggered the trigger?
END;