Handle watchstatus of entries without history entry

This commit is contained in:
Zoe Roux
2026-03-31 17:55:39 +02:00
parent d3a929855a
commit f126a0592e
8 changed files with 2082 additions and 8 deletions
+3 -1
View File
@@ -1,5 +1,5 @@
import { sql } from "drizzle-orm";
import { check, index, integer, timestamp } from "drizzle-orm/pg-core";
import { boolean, check, index, integer, timestamp } from "drizzle-orm/pg-core";
import { entries } from "./entries";
import { profiles } from "./profiles";
import { schema } from "./utils";
@@ -23,6 +23,8 @@ export const history = schema.table(
playedDate: timestamp({ withTimezone: true, precision: 3 })
.notNull()
.defaultNow(),
// true if the user only marked the entry has seen and has not seen it on kyoo
external: boolean().notNull(),
},
(t) => [
index("history_play_date").on(t.playedDate.desc()),