ensuretriggers.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:healthchecks_asgards 作者: andela 项目源码 文件源码
def _sqlite(cursor):
    cursor.execute("""
    DROP TRIGGER IF EXISTS update_alert_after;
    """)

    cursor.execute("""
    CREATE TRIGGER update_alert_after
    AFTER UPDATE OF last_ping, timeout, grace ON api_check
    FOR EACH ROW BEGIN
        UPDATE api_check
        SET alert_after =
            datetime(strftime('%s', last_ping) +
            timeout/1000000 + grace/1000000, 'unixepoch')
        WHERE id = OLD.id;
    END;
    """)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号