mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-16 23:41:11 +02:00
Sqlite migration done
This commit is contained in:
parent
ebde149980
commit
80656f48e0
3 changed files with 28 additions and 2 deletions
|
@ -229,7 +229,7 @@ export const configSchema = z
|
|||
disable_local_sites: z.boolean().optional(),
|
||||
disable_basic_wireguard_sites: z.boolean().optional(),
|
||||
disable_config_managed_domains: z.boolean().optional(),
|
||||
enable_clients: z.boolean().optional()
|
||||
enable_clients: z.boolean().optional().default(true),
|
||||
})
|
||||
.optional(),
|
||||
dns: z
|
||||
|
|
25
server/setup/scriptsPg/1.8.0.ts
Normal file
25
server/setup/scriptsPg/1.8.0.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { db } from "@server/db/pg/driver";
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
const version = "1.7.0";
|
||||
|
||||
export default async function migration() {
|
||||
console.log(`Running setup script ${version}...`);
|
||||
|
||||
try {
|
||||
await db.execute(sql`
|
||||
BEGIN;
|
||||
|
||||
|
||||
COMMIT;
|
||||
`);
|
||||
|
||||
console.log(`Migrated database schema`);
|
||||
} catch (e) {
|
||||
console.log("Unable to migrate database schema");
|
||||
console.log(e);
|
||||
throw e;
|
||||
}
|
||||
|
||||
console.log(`${version} migration complete`);
|
||||
}
|
|
@ -13,9 +13,10 @@ export default async function migration() {
|
|||
try {
|
||||
db.transaction(() => {
|
||||
db.exec(`
|
||||
ALTER TABLE 'resources' ADD 'enableProxy' integer DEFAULT true;
|
||||
ALTER TABLE 'sites' ADD 'remoteSubnets' text;
|
||||
ALTER TABLE 'user' ADD 'termsAcceptedTimestamp' text;
|
||||
ALTER TABLE 'user' ADD 'termsVersion' text;
|
||||
ALTER TABLE 'sites' ADD 'remoteSubnets' text;
|
||||
`);
|
||||
})();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue