Clean up migrations

This commit is contained in:
Owen 2025-07-28 17:32:15 -07:00
parent 4d7e25f97b
commit d732c1a845
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import { db } from "@server/db/pg/driver"; import { db } from "@server/db/pg/driver";
import { sql } from "drizzle-orm"; import { sql } from "drizzle-orm";
const version = "1.7.0"; const version = "1.8.0";
export default async function migration() { export default async function migration() {
console.log(`Running setup script ${version}...`); console.log(`Running setup script ${version}...`);
@ -16,7 +16,7 @@ export default async function migration() {
ALTER TABLE "resources" ADD COLUMN "enableProxy" boolean DEFAULT true; ALTER TABLE "resources" ADD COLUMN "enableProxy" boolean DEFAULT true;
ALTER TABLE "sites" ADD COLUMN "remoteSubnets" text; ALTER TABLE "sites" ADD COLUMN "remoteSubnets" text;
ALTER TABLE "user" ADD COLUMN "termsAcceptedTimestamp" varchar; ALTER TABLE "user" ADD COLUMN "termsAcceptedTimestamp" varchar;
ALTER TABLE "user" ADD COLUMN "termsVersion" varchar; ALTER TABLE "user" ADD COLUMN "termsVersion" varchar;
COMMIT; COMMIT;
`); `);

View file

@ -5,7 +5,7 @@ import path from "path";
const version = "1.8.0"; const version = "1.8.0";
export default async function migration() { export default async function migration() {
console.log("Running setup script ${version}..."); console.log(`Running setup script ${version}...`);
const location = path.join(APP_PATH, "db", "db.sqlite"); const location = path.join(APP_PATH, "db", "db.sqlite");
const db = new Database(location); const db = new Database(location);
@ -13,7 +13,7 @@ export default async function migration() {
try { try {
db.transaction(() => { db.transaction(() => {
db.exec(` db.exec(`
ALTER TABLE 'resources' ADD 'enableProxy' integer DEFAULT true; ALTER TABLE 'resources' ADD 'enableProxy' integer DEFAULT 1;
ALTER TABLE 'sites' ADD 'remoteSubnets' text; ALTER TABLE 'sites' ADD 'remoteSubnets' text;
ALTER TABLE 'user' ADD 'termsAcceptedTimestamp' text; ALTER TABLE 'user' ADD 'termsAcceptedTimestamp' text;
ALTER TABLE 'user' ADD 'termsVersion' text; ALTER TABLE 'user' ADD 'termsVersion' text;