Private
Public Access
1
0

kordophone-db: switch to diesel for more features

This commit is contained in:
2024-12-14 19:03:27 -08:00
parent 86601b027a
commit f79cbbbc85
12 changed files with 432 additions and 249 deletions

View File

View File

@@ -0,0 +1,4 @@
-- This file should undo anything in `up.sql`
DROP TABLE IF EXISTS `participants`;
DROP TABLE IF EXISTS `conversation_participants`;
DROP TABLE IF EXISTS `conversations`;

View File

@@ -0,0 +1,20 @@
-- Your SQL goes here
CREATE TABLE `participants`(
`id` INTEGER NOT NULL PRIMARY KEY,
`display_name` TEXT NOT NULL
);
CREATE TABLE `conversation_participants`(
`conversation_id` TEXT NOT NULL,
`participant_id` INTEGER NOT NULL,
PRIMARY KEY(`conversation_id`, `participant_id`)
);
CREATE TABLE `conversations`(
`id` TEXT NOT NULL PRIMARY KEY,
`unread_count` BIGINT NOT NULL,
`display_name` TEXT,
`last_message_preview` TEXT,
`date` TIMESTAMP NOT NULL
);