mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-10 01:23:31 +00:00
Set the target port from the resource
This commit is contained in:
@@ -274,6 +274,12 @@ export default async function migration() {
|
||||
await db.execute(
|
||||
sql`ALTER TABLE "targets" ADD "mode" text DEFAULT 'http' NOT NULL;`
|
||||
);
|
||||
await db.execute(sql`
|
||||
UPDATE "targets"
|
||||
SET "mode" = "resources"."mode"
|
||||
FROM "resources"
|
||||
WHERE "resources"."resourceId" = "targets"."resourceId";
|
||||
`);
|
||||
await db.execute(sql`ALTER TABLE "targets" ADD "authToken" text;`);
|
||||
|
||||
await db.execute(sql`COMMIT`);
|
||||
|
||||
@@ -339,6 +339,15 @@ export default async function migration() {
|
||||
ALTER TABLE 'targets' ADD 'mode' text DEFAULT 'http' NOT NULL;
|
||||
`
|
||||
).run();
|
||||
db.prepare(
|
||||
`
|
||||
UPDATE 'targets'
|
||||
SET 'mode' = (
|
||||
SELECT 'mode' FROM 'resources'
|
||||
WHERE 'resources'.'resourceId' = 'targets'.'resourceId'
|
||||
);
|
||||
`
|
||||
).run();
|
||||
db.prepare(
|
||||
`
|
||||
ALTER TABLE 'targets' ADD 'authToken' text;
|
||||
|
||||
Reference in New Issue
Block a user