aboutsummaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
authorNathan Perry <avaglir@gmail.com>2019-03-08 16:57:27 -0500
committerNathan Perry <avaglir@gmail.com>2019-03-08 16:57:27 -0500
commit86025df1f6d814c98a14211ceb4da6cf6de915c7 (patch)
treec615b6634eea05498d772f68aec2d52fa3ca4f01 /migrations
parent24a7cb3c8eb0517b69c145170765c891a82ccc76 (diff)
first pass with oauth
Diffstat (limited to 'migrations')
-rw-r--r--migrations/2019-03-08-073831_store-token/down.sql2
-rw-r--r--migrations/2019-03-08-073831_store-token/up.sql10
2 files changed, 12 insertions, 0 deletions
diff --git a/migrations/2019-03-08-073831_store-token/down.sql b/migrations/2019-03-08-073831_store-token/down.sql
new file mode 100644
index 0000000..c2bacf0
--- /dev/null
+++ b/migrations/2019-03-08-073831_store-token/down.sql
@@ -0,0 +1,2 @@
+DROP INDEX oauth_token_exp_index;
+DROP TABLE google_oauth_tokens;
diff --git a/migrations/2019-03-08-073831_store-token/up.sql b/migrations/2019-03-08-073831_store-token/up.sql
new file mode 100644
index 0000000..94f826b
--- /dev/null
+++ b/migrations/2019-03-08-073831_store-token/up.sql
@@ -0,0 +1,10 @@
+CREATE TABLE google_oauth_tokens (
+ id SERIAL PRIMARY KEY,
+ token VARCHAR NOT NULL,
+ refresh_token VARCHAR NOT NULL,
+ expiration TIMESTAMP NOT NULL,
+ created TIMESTAMP NOT NULL DEFAULT current_timestamp
+);
+
+CREATE INDEX oauth_token_exp_index ON google_oauth_tokens (expiration);
+CREATE INDEX oauth_token_created_index ON google_oauth_tokens (created);