From 83a06bfbd18e4f539b8e42e8e65d719040863100 Mon Sep 17 00:00:00 2001
From: Nathan Perry <avaglir@gmail.com>
Date: Sun, 3 Mar 2019 02:39:24 -0500
Subject: record meme invocations

---
 migrations/2019-03-03-045503_meme_invocation_records/up.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 migrations/2019-03-03-045503_meme_invocation_records/up.sql

(limited to 'migrations/2019-03-03-045503_meme_invocation_records/up.sql')

diff --git a/migrations/2019-03-03-045503_meme_invocation_records/up.sql b/migrations/2019-03-03-045503_meme_invocation_records/up.sql
new file mode 100644
index 0000000..a81c273
--- /dev/null
+++ b/migrations/2019-03-03-045503_meme_invocation_records/up.sql
@@ -0,0 +1,12 @@
+CREATE TABLE invocation_records (
+    id SERIAL PRIMARY KEY,
+    user_id BIGINT NOT NULL,
+    message_id BIGINT NOT NULL,
+    meme_id INTEGER NOT NULL,
+    time TIMESTAMP NOT NULL DEFAULT current_timestamp,
+    random BOOLEAN NOT NULL
+);
+
+CREATE INDEX invocation_user_id ON invocation_records (user_id);
+CREATE INDEX invocation_time ON invocation_records (time);
+CREATE INDEX invocation_meme_random ON invocation_records (meme_id, random);
-- 
cgit v1.3.1

