mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-27 23:36:39 +00:00
Fix exitNodeId col
This commit is contained in:
@@ -11,7 +11,7 @@ export default async function migration() {
|
|||||||
|
|
||||||
// Get the first exit node with type 'gerbil'
|
// Get the first exit node with type 'gerbil'
|
||||||
const exitNodesQuery = await db.execute(
|
const exitNodesQuery = await db.execute(
|
||||||
sql`SELECT "exitNodeId" FROM "exitNodes" WHERE "type" = 'gerbil' LIMIT 1`
|
sql`SELECT * FROM "exitNodes" WHERE "type" = 'gerbil' LIMIT 1`
|
||||||
);
|
);
|
||||||
const exitNodes = exitNodesQuery.rows as {
|
const exitNodes = exitNodesQuery.rows as {
|
||||||
exitNodeId: number;
|
exitNodeId: number;
|
||||||
@@ -30,7 +30,7 @@ export default async function migration() {
|
|||||||
// Update sites to use the exit node
|
// Update sites to use the exit node
|
||||||
for (const site of sites) {
|
for (const site of sites) {
|
||||||
await db.execute(sql`
|
await db.execute(sql`
|
||||||
UPDATE "sites" SET "exitNodeId" = ${exitNodeId} WHERE "siteId" = ${site.siteId}
|
UPDATE "sites" SET "exitNode" = ${exitNodeId} WHERE "siteId" = ${site.siteId}
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default async function migration() {
|
|||||||
}[];
|
}[];
|
||||||
|
|
||||||
const defineExitNodeOnSite = db.prepare(
|
const defineExitNodeOnSite = db.prepare(
|
||||||
`UPDATE sites SET exitNodeId = ? WHERE siteId = ?`
|
`UPDATE sites SET exitNode = ? WHERE siteId = ?`
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const site of sites) {
|
for (const site of sites) {
|
||||||
|
|||||||
Reference in New Issue
Block a user