feat: add core backend modules, inventory services, and patch scripts for AI Pharmacy API
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const { pool } = require('./src/db/pool');
|
||||
|
||||
async function deleteInventory() {
|
||||
const client = await pool.connect();
|
||||
try {
|
||||
await client.query('BEGIN');
|
||||
|
||||
await client.query('DELETE FROM inventory_adjustments;');
|
||||
await client.query('DELETE FROM stock_movements;');
|
||||
await client.query('DELETE FROM batches;');
|
||||
|
||||
await client.query('COMMIT');
|
||||
console.log("Successfully deleted all inventory data (batches, stock_movements, inventory_adjustments).");
|
||||
} catch (err) {
|
||||
await client.query('ROLLBACK');
|
||||
console.error("Error deleting data:", err);
|
||||
} finally {
|
||||
client.release();
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
|
||||
deleteInventory();
|
||||
Reference in New Issue
Block a user