feat(core): resume suspended sessions after service restart (#36105)

This commit is contained in:
Kit Langton 2026-07-09 13:19:15 -04:00 committed by GitHub
commit 6524dfc818
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 820 additions and 299 deletions

View file

@ -0,0 +1,14 @@
import { Effect } from "effect"
import type { DatabaseMigration } from "../migration"
export default {
id: "20260709163752_time_suspended",
up(tx) {
return Effect.gen(function* () {
yield* tx.run(`ALTER TABLE \`session\` ADD \`time_suspended\` integer;`)
yield* tx.run(
`CREATE INDEX \`session_time_suspended_idx\` ON \`session\` (\`time_suspended\`) WHERE "session"."time_suspended" is not null;`,
)
})
},
} satisfies DatabaseMigration.Migration