diff options
| author | Nathan Perry <avaglir@gmail.com> | 2019-03-03 02:39:24 -0500 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2019-03-03 02:39:24 -0500 |
| commit | 83a06bfbd18e4f539b8e42e8e65d719040863100 (patch) | |
| tree | 93e93db99ee97b75672f714e48fdfd3ce53bde92 /migrations | |
| parent | 410596f875111fab3d666a472c61be8869d7f7ec (diff) | |
record meme invocations
Diffstat (limited to 'migrations')
| -rw-r--r-- | migrations/2019-03-03-045503_meme_invocation_records/down.sql | 5 | ||||
| -rw-r--r-- | migrations/2019-03-03-045503_meme_invocation_records/up.sql | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/migrations/2019-03-03-045503_meme_invocation_records/down.sql b/migrations/2019-03-03-045503_meme_invocation_records/down.sql new file mode 100644 index 0000000..41333ae --- /dev/null +++ b/migrations/2019-03-03-045503_meme_invocation_records/down.sql @@ -0,0 +1,5 @@ +DROP INDEX invocation_user_id; +DROP INDEX invocation_time; +DROP INDEX invocation_meme_random; + +DROP TABLE invocation_records; 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); |
