initial polls support (not exactly working)
This commit is contained in:
committed by
Cadence Ember
parent
2496f4c3b0
commit
e565342ac8
19
src/db/migrations/0031-add-polls.sql
Normal file
19
src/db/migrations/0031-add-polls.sql
Normal 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
12
src/db/orm-defs.d.ts
vendored
@@ -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> = {
|
||||
|
||||
Reference in New Issue
Block a user