mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-18 00:09:34 +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_local_sites: z.boolean().optional(),
|
||||||
disable_basic_wireguard_sites: z.boolean().optional(),
|
disable_basic_wireguard_sites: z.boolean().optional(),
|
||||||
disable_config_managed_domains: z.boolean().optional(),
|
disable_config_managed_domains: z.boolean().optional(),
|
||||||
enable_clients: z.boolean().optional()
|
enable_clients: z.boolean().optional().default(true),
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
dns: z
|
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 {
|
try {
|
||||||
db.transaction(() => {
|
db.transaction(() => {
|
||||||
db.exec(`
|
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 'termsAcceptedTimestamp' text;
|
||||||
ALTER TABLE 'user' ADD 'termsVersion' text;
|
ALTER TABLE 'user' ADD 'termsVersion' text;
|
||||||
ALTER TABLE 'sites' ADD 'remoteSubnets' text;
|
|
||||||
`);
|
`);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue