mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-22 22:09:06 +02:00
Removed migrations
This commit is contained in:
@@ -1,35 +0,0 @@
|
||||
import { APP_PATH } from "@server/lib/consts";
|
||||
import Database from "better-sqlite3";
|
||||
import path from "path";
|
||||
|
||||
const version = "1.18.5";
|
||||
|
||||
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.pragma("foreign_keys = OFF");
|
||||
|
||||
db.transaction(() => {
|
||||
db.prepare(
|
||||
`ALTER TABLE "resources" RENAME COLUMN "headers" TO "requestHeaders";`
|
||||
).run();
|
||||
db.prepare(
|
||||
`ALTER TABLE "resources" ADD "responseHeaders" text;`
|
||||
).run();
|
||||
})();
|
||||
|
||||
console.log("Migrated database");
|
||||
} catch (e) {
|
||||
console.log("Failed to migrate db:", e);
|
||||
throw e;
|
||||
} finally {
|
||||
db.pragma("foreign_keys = ON");
|
||||
db.close();
|
||||
}
|
||||
|
||||
console.log(`${version} migration complete`);
|
||||
}
|
||||
Reference in New Issue
Block a user