mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-29 06:08:15 +02:00
Merge branch 'main' into copilot/fix-1112
This commit is contained in:
commit
e9e6b0bc4f
77 changed files with 4113 additions and 1256 deletions
30
server/setup/scriptsSqlite/1.8.0.ts
Normal file
30
server/setup/scriptsSqlite/1.8.0.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
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 'resources' ADD 'enableProxy' integer DEFAULT 1;
|
||||
ALTER TABLE 'sites' ADD 'remoteSubnets' text;
|
||||
ALTER TABLE 'user' ADD 'termsAcceptedTimestamp' text;
|
||||
ALTER TABLE 'user' ADD 'termsVersion' text;
|
||||
`);
|
||||
})();
|
||||
|
||||
console.log("Migrated database schema");
|
||||
} catch (e) {
|
||||
console.log("Unable to migrate database schema");
|
||||
throw e;
|
||||
}
|
||||
|
||||
console.log(`${version} migration complete`);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue