Add compact calendar responses and persisted habit change versions

This commit is contained in:
syntaxbullet
2026-09-08 16:14:58 +02:00
parent 85376a54b3
commit 4b8c7dff05
7 changed files with 1276 additions and 8 deletions

View File

@@ -33,6 +33,7 @@ export const discordDeliveries = sqliteTable("discord_deliveries", {
// Revisions are append-only, including multiple edits on the same local date.
export const habits = sqliteTable('habits', {
id: text('id').primaryKey(), userId: text('user_id').notNull().references(() => users.id),
calendarRevision: integer('calendar_revision').notNull().default(0),
createdDate: text('created_date').notNull(), materializedThrough: text('materialized_through'), createdAt: integer('created_at').notNull(),
}, t => [index('habits_user_idx').on(t.userId)]);
export const habitRevisions = sqliteTable('habit_revisions', {