Diesel migrations
This commit is contained in:
2
migrations/2022-11-04-173903_create_karma/down.sql
Normal file
2
migrations/2022-11-04-173903_create_karma/down.sql
Normal file
@ -0,0 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE karma
|
11
migrations/2022-11-04-173903_create_karma/up.sql
Normal file
11
migrations/2022-11-04-173903_create_karma/up.sql
Normal 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()
|
||||
)
|
Reference in New Issue
Block a user