feat(migrate): quality alert migrated

This commit is contained in:
2026-04-10 13:57:15 -05:00
parent 07ebf88806
commit b0e5fd7999
7 changed files with 371 additions and 1 deletions

View File

@@ -0,0 +1,46 @@
import pkg from "pg";
const { Client } = pkg;
const v1client = new Client({
host: "localhost",
port: 5432,
user: "postgres",
password: "obelix",
database: "lst",
});
const v2client = new Client({
host: "localhost",
port: 5432,
user: "postgres",
password: "obelix",
database: "lst_db",
});
export const v1QueryRun= async (query:string)=> {
try {
await v1client.connect();
const res = await v1client.query(query);
console.log("Rows affected:", res.rowCount);
} catch (err) {
console.error("Error running query:", err);
} finally {
await v1client.end();
}
}
export const v2QueryRun = async (query:string)=> {
try {
await v2client.connect();
const res = await v2client.query(query);
console.log("Rows affected:", res.rowCount);
} catch (err) {
console.error("Error running query:", err);
} finally {
await v2client.end();
}
}