feat: add signed Discord command foundation and daily check-ins
This commit is contained in:
@@ -101,3 +101,15 @@ export const liveDiscordCards = sqliteTable('live_discord_cards', {
|
||||
retryAt: integer('retry_at'),
|
||||
updatedAt: integer('updated_at').notNull(),
|
||||
});
|
||||
|
||||
// Short-lived UI state and replay receipts; no Discord interaction tokens are persisted.
|
||||
export const discordControls = sqliteTable('discord_controls', {
|
||||
id: text('id').primaryKey(), userId: text('user_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
|
||||
action: text('action').notNull(), payload: text('payload', { mode: 'json' }).$type<import('../discord/types').ControlData>().notNull(),
|
||||
expiresAt: integer('expires_at').notNull(), used: integer('used', { mode: 'boolean' }).notNull().default(false),
|
||||
}, t => [index('discord_controls_expiry_idx').on(t.expiresAt)]);
|
||||
export const discordReceipts = sqliteTable('discord_receipts', {
|
||||
id: text('id').primaryKey(), userId: text('user_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
|
||||
response: text('response', { mode: 'json' }).$type<import('../discord/types').Reply>().notNull(),
|
||||
expiresAt: integer('expires_at').notNull(),
|
||||
}, t => [index('discord_receipts_expiry_idx').on(t.expiresAt)]);
|
||||
|
||||
Reference in New Issue
Block a user