mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-05 23:28:44 +00:00
Handle the new added mode column
This commit is contained in:
@@ -265,6 +265,17 @@ export default async function migration() {
|
||||
ALTER TABLE 'resources' ADD 'mode' text DEFAULT 'http' NOT NULL;
|
||||
`
|
||||
).run();
|
||||
db.prepare(
|
||||
`
|
||||
UPDATE 'resources'
|
||||
SET "mode" = CASE
|
||||
WHEN COALESCE("http", 1) = 1 THEN 'http'
|
||||
WHEN COALESCE("http", 0) = 0 AND LOWER(COALESCE("protocol", '')) = 'tcp' THEN 'tcp'
|
||||
WHEN COALESCE("http", 0) = 0 AND LOWER(COALESCE("protocol", '')) = 'udp' THEN 'udp'
|
||||
ELSE 'http'
|
||||
END;
|
||||
`
|
||||
).run();
|
||||
db.prepare(
|
||||
`
|
||||
ALTER TABLE 'resources' ADD 'pamMode' text DEFAULT 'passthrough';
|
||||
|
||||
Reference in New Issue
Block a user