add subscribing and unsubscribing to threads
This commit is contained in:
@ -102,4 +102,15 @@ return {
|
||||
|
||||
db.query("CREATE INDEX idx_rate_limit_user_method ON api_rate_limits (user_id, method)")
|
||||
end,
|
||||
|
||||
[13] = function ()
|
||||
schema.create_table("subscriptions", {
|
||||
{"id", types.integer{primary_key = true}},
|
||||
{"user_id", "INTEGER REFERENCES users(id) ON DELETE CASCADE"},
|
||||
{"thread_id", "INTEGER REFERENCES threads(id) ON DELETE CASCADE"},
|
||||
{"last_seen", "INTEGER DEFAULT (unixepoch(CURRENT_TIMESTAMP)) NOT NULL"},
|
||||
})
|
||||
|
||||
db.query("CREATE INDEX idx_subscription_user_thread ON subscriptions (user_id, thread_id)")
|
||||
end,
|
||||
}
|
||||
|
Reference in New Issue
Block a user