Files
AI_Pharmacy_Api/alter_db.js
T
2026-07-29 11:38:27 +05:30

18 lines
440 B
JavaScript

const { Pool } = require('pg');
const pool = new Pool({
connectionString: 'postgres://postgres:csh%402018@localhost:5432/ai_pharmacy'
});
async function run() {
try {
await pool.query('ALTER TABLE dispensing_records ADD COLUMN IF NOT EXISTS prescription_id VARCHAR(50)');
console.log('Successfully added prescription_id column.');
} catch (err) {
console.error('Error:', err);
} finally {
pool.end();
}
}
run();