add: channels/messages database functions

chore: bump contrasted
This commit is contained in:
trisua 2025-04-25 16:22:38 -04:00
parent 4cafea66aa
commit a28072be7f
11 changed files with 358 additions and 6 deletions

View file

@ -13,3 +13,5 @@ pub const CREATE_TABLE_USER_WARNINGS: &str = include_str!("./sql/create_user_war
pub const CREATE_TABLE_REQUESTS: &str = include_str!("./sql/create_requests.sql");
pub const CREATE_TABLE_QUESTIONS: &str = include_str!("./sql/create_questions.sql");
pub const CREATE_TABLE_IPBLOCKS: &str = include_str!("./sql/create_ipblocks.sql");
pub const CREATE_TABLE_CHANNELS: &str = include_str!("./sql/create_channels.sql");
pub const CREATE_TABLE_MESSAGES: &str = include_str!("./sql/create_messages.sql");

View file

@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS channels (
id BIGINT NOT NULL PRIMARY KEY,
community BIGINT NOT NULL,
owner BIGINT NOT NULL,
created BIGINT NOT NULL,
minimum_role_read INT NOT NULL,
minimum_role_write INT NOT NULL,
position INT NOT NULL
)

View file

@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS messages (
id BIGINT NOT NULL PRIMARY KEY,
channel BIGINT NOT NULL,
owner BIGINT NOT NULL,
created BIGINT NOT NULL,
edited BIGINT NOT NULL,
content TEXT NOT NULL,
context TEXT NOT NULL
)