From bb8b21bad4dd1ff009420115a7c2ff8e45eb058d Mon Sep 17 00:00:00 2001 From: Michael-Andrew Keays Date: Sun, 15 Dec 2024 11:59:28 -0500 Subject: [PATCH] db table for poll answer --- .../src/data-plane/server/db/database-schema.ts | 4 +++- .../data-plane/server/db/tables/poll-answer.ts | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 packages/bsky/src/data-plane/server/db/tables/poll-answer.ts diff --git a/packages/bsky/src/data-plane/server/db/database-schema.ts b/packages/bsky/src/data-plane/server/db/database-schema.ts index 195b09483e0..3550bf15813 100644 --- a/packages/bsky/src/data-plane/server/db/database-schema.ts +++ b/packages/bsky/src/data-plane/server/db/database-schema.ts @@ -37,6 +37,7 @@ import * as blobTakedown from './tables/blob-takedown' import * as labeler from './tables/labeler' import * as starterPack from './tables/starter-pack' import * as quote from './tables/quote' +import * as pollAnswer from './tables/poll-answer' export type DatabaseSchemaType = duplicateRecord.PartialDB & profile.PartialDB & @@ -75,7 +76,8 @@ export type DatabaseSchemaType = duplicateRecord.PartialDB & labeler.PartialDB & starterPack.PartialDB & taggedSuggestion.PartialDB & - quote.PartialDB + quote.PartialDB & + pollAnswer.PartialDB export type DatabaseSchema = Kysely diff --git a/packages/bsky/src/data-plane/server/db/tables/poll-answer.ts b/packages/bsky/src/data-plane/server/db/tables/poll-answer.ts new file mode 100644 index 00000000000..fc993158357 --- /dev/null +++ b/packages/bsky/src/data-plane/server/db/tables/poll-answer.ts @@ -0,0 +1,17 @@ +import { GeneratedAlways } from 'kysely' + +const tableName = 'poll_answer' + +export interface PollAnswer { + uri: string + cid: string + creator: string + subject: string + subjectCid: string + createdAt: string + indexedAt: string + answer: number + sortAt: GeneratedAlways +} + +export type PartialDB = { [tableName]: PollAnswer }