feat: refactor character history schema and related logic for improved date handling and data integrity

This commit is contained in:
2026-03-02 12:19:56 +01:00
parent ef7ef4dd6c
commit 60d2474f51
6 changed files with 1126 additions and 12 deletions

View File

@@ -100,7 +100,7 @@ export const characterHistory = sqliteTable('characterHistory', {
.primaryKey()
.$defaultFn(() => crypto.randomUUID()),
characterId: text('characterId').references(() => character.id),
date: text('date'),
date: integer('date').notNull().unique(),
won: integer('won').notNull().default(0),
createdAt: integer('createdAt').notNull().$default(() => Date.now()),
updatedAt: integer('updatedAt').notNull().$default(() => Date.now()),