Diesel migrations

This commit is contained in:
2022-11-06 02:39:13 +03:00
parent 960a509385
commit 39af0b2c10
18 changed files with 225 additions and 0 deletions

View File

@ -0,0 +1,2 @@
-- This file should undo anything in `up.sql`
DROP TABLE karma

View File

@ -0,0 +1,11 @@
-- Your SQL goes here
create TABLE karma (
id BIGSERIAL PRIMARY KEY,
chat_id BIGINT REFERENCES chats(id) NOT NULL,
user_from BIGINT REFERENCES users(id) NOT NULL,
user_to BIGINT REFERENCES users(id) NOT NULL,
karma SMALLINT NOT NULL,
message_id BIGINT NOT NULL,
message_text TEXT,
created TIMESTAMPTZ NOT NULL DEFAULT NOW()
)