Fix exitNodeId col

This commit is contained in:
Owen
2025-10-20 21:34:10 -07:00
parent 18d8f72da2
commit d10830f892
2 changed files with 3 additions and 3 deletions

View File

@@ -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}
`); `);
} }

View File

@@ -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) {