summaryrefslogtreecommitdiff
path: root/migrations/029_oauth_tokens.sql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/029_oauth_tokens.sql')
-rw-r--r--migrations/029_oauth_tokens.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/migrations/029_oauth_tokens.sql b/migrations/029_oauth_tokens.sql
new file mode 100644
index 0000000..c3b0364
--- /dev/null
+++ b/migrations/029_oauth_tokens.sql
@@ -0,0 +1,12 @@
+-- OAuth 2.0 token storage for integrations that need real user-consent auth
+-- (starting with Google Tasks, whose API has no service-account-friendly
+-- sharing model the way Calendar does). One row per source; access_token
+-- and expiry get overwritten on every refresh, refresh_token persists.
+CREATE TABLE IF NOT EXISTS oauth_tokens (
+ source TEXT PRIMARY KEY,
+ access_token TEXT NOT NULL,
+ refresh_token TEXT NOT NULL,
+ token_type TEXT NOT NULL DEFAULT 'Bearer',
+ expiry DATETIME,
+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
+);