create orders enpoints fixed

This commit is contained in:
Suriya
2026-07-21 11:36:46 +05:30
parent 3da5876e4c
commit 994e6f5b07
3 changed files with 622 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
const { Client } = require('pg');
const client = new Client({
host: '66.116.207.225',
port: 5433,
database: 'nearledb',
user: 'admin',
password: 'Package@123#',
ssl: false,
});
async function main() {
try {
await client.connect();
console.log('Connected successfully!');
console.log('\n--- Updating orders 140533 and 140534 to "created" status ---');
const updateRes = await client.query(
"UPDATE orders SET orderstatus = 'created', pending = '' WHERE orderheaderid IN (140533, 140534)"
);
console.log(`Updated ${updateRes.rowCount} orders.`);
console.log('\n--- Verification ---');
const verifyRes = await client.query(
"SELECT orderheaderid, orderid, orderstatus, pending, processing, ready, delivered, cancelled FROM orders WHERE orderheaderid IN (140533, 140534)"
);
console.table(verifyRes.rows);
} catch (err) {
console.error('Error executing update:', err);
} finally {
await client.end();
}
}
main();