initial polls support (not exactly working)

This commit is contained in:
Ellie Algase
2026-01-24 18:43:30 -06:00
committed by Cadence Ember
parent 2496f4c3b0
commit e565342ac8
16 changed files with 749 additions and 14 deletions

View File

@@ -0,0 +1,19 @@
BEGIN TRANSACTION;
CREATE TABLE "poll_option" (
"message_id" TEXT NOT NULL,
"matrix_option" TEXT NOT NULL,
"discord_option" TEXT NOT NULL,
PRIMARY KEY("message_id","matrix_option")
FOREIGN KEY ("message_id") REFERENCES "message_channel" ("message_id") ON DELETE CASCADE
) WITHOUT ROWID;
CREATE TABLE "poll_vote" (
"vote" TEXT NOT NULL,
"message_id" TEXT NOT NULL,
"discord_or_matrix_user_id" TEXT NOT NULL,
PRIMARY KEY("vote","message_id","discord_or_matrix_user_id"),
FOREIGN KEY("message_id") REFERENCES "message_channel" ("message_id") ON DELETE CASCADE
) WITHOUT ROWID;
COMMIT;

12
src/db/orm-defs.d.ts vendored
View File

@@ -139,6 +139,18 @@ export type Models = {
encoded_emoji: string
original_encoding: string | null
}
poll_vote: {
vote: string
message_id: string
discord_or_matrix_user_id: string
}
poll_option: {
message_id: string
matrix_option: string
discord_option: string
}
}
export type Prepared<Row> = {