aboutsummaryrefslogtreecommitdiff
path: root/migrations/2019-03-03-045503_meme_invocation_records/up.sql
blob: a81c273d5a06bb5b49e33c4eafa98dbfa2fc11d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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);