Basic clients working

This commit is contained in:
Owen 2025-07-27 10:21:27 -07:00
parent 15adfcca8c
commit 28f8b05dbc
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
21 changed files with 387 additions and 87 deletions

View file

@ -0,0 +1,29 @@
import { APP_PATH } from "@server/lib/consts";
import Database from "better-sqlite3";
import path from "path";
const version = "1.8.0";
export default async function migration() {
console.log("Running setup script ${version}...");
const location = path.join(APP_PATH, "db", "db.sqlite");
const db = new Database(location);
try {
db.transaction(() => {
db.exec(`
ALTER TABLE 'user' ADD 'termsAcceptedTimestamp' text;
ALTER TABLE 'user' ADD 'termsVersion' text;
ALTER TABLE 'sites' ADD 'remoteSubnets' text;
`);
})();
console.log("Migrated database schema");
} catch (e) {
console.log("Unable to migrate database schema");
throw e;
}
console.log(`${version} migration complete`);
}