This commit is contained in:
Owen
2025-10-04 18:36:44 -07:00
parent 3123f858bb
commit c2c907852d
320 changed files with 35785 additions and 2984 deletions

View File

@@ -1,4 +1,5 @@
import { db } from "@server/db";
import { build } from "@server/build";
import { db, sessionTransferToken } from "@server/db";
import {
emailVerificationCodes,
newtSessions,
@@ -76,4 +77,16 @@ export async function clearStaleData() {
} catch (e) {
logger.warn("Error clearing expired resourceOtp:", e);
}
if (build !== "oss") {
try {
await db
.delete(sessionTransferToken)
.where(
lt(sessionTransferToken.expiresAt, new Date().getTime())
);
} catch (e) {
logger.warn("Error clearing expired sessionTransferToken:", e);
}
}
}

View File

@@ -136,7 +136,7 @@ async function executeScripts() {
const pendingMigrations = lastExecuted
.map((m) => m)
.sort((a, b) => semver.compare(b.version, a.version));
const startVersion = pendingMigrations[0]?.version ?? "0.0.0";
const startVersion = pendingMigrations[0]?.version ?? APP_VERSION;
console.log(`Starting migrations from version ${startVersion}`);
const migrationsToRun = migrations.filter((migration) =>