mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-21 04:56:40 +02: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(
|
await db.execute(
|
||||||
sql`ALTER TABLE "targets" ADD "mode" text DEFAULT 'http' NOT NULL;`
|
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`ALTER TABLE "targets" ADD "authToken" text;`);
|
||||||
|
|
||||||
await db.execute(sql`COMMIT`);
|
await db.execute(sql`COMMIT`);
|
||||||
|
|||||||
@@ -339,6 +339,15 @@ export default async function migration() {
|
|||||||
ALTER TABLE 'targets' ADD 'mode' text DEFAULT 'http' NOT NULL;
|
ALTER TABLE 'targets' ADD 'mode' text DEFAULT 'http' NOT NULL;
|
||||||
`
|
`
|
||||||
).run();
|
).run();
|
||||||
|
db.prepare(
|
||||||
|
`
|
||||||
|
UPDATE 'targets'
|
||||||
|
SET 'mode' = (
|
||||||
|
SELECT 'mode' FROM 'resources'
|
||||||
|
WHERE 'resources'.'resourceId' = 'targets'.'resourceId'
|
||||||
|
);
|
||||||
|
`
|
||||||
|
).run();
|
||||||
db.prepare(
|
db.prepare(
|
||||||
`
|
`
|
||||||
ALTER TABLE 'targets' ADD 'authToken' text;
|
ALTER TABLE 'targets' ADD 'authToken' text;
|
||||||
|
|||||||
Reference in New Issue
Block a user