mirror of
https://github.com/mblanke/Gov_Travel_App.git
synced 2026-03-01 14:10:22 -05:00
feat: add scripts for database inspection and migration
- Implemented multiple scripts to check and inspect meal plans, scraped data, and accommodations for Munich and Riga. - Added a migration script to convert scraped data into the application's database format. - Introduced new database service methods for querying and updating travel rates. - Enhanced server configuration for serving static files in production. - Updated PostCSS configuration for consistency.
This commit is contained in:
41
scripts/updateRiga.js
Normal file
41
scripts/updateRiga.js
Normal file
@@ -0,0 +1,41 @@
|
||||
const db = require("../services/databaseService");
|
||||
|
||||
async function updateRigaRate() {
|
||||
await db.connect();
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
db.db.run(
|
||||
`
|
||||
UPDATE travel_rates
|
||||
SET jan_accommodation = 209,
|
||||
feb_accommodation = 209,
|
||||
mar_accommodation = 209,
|
||||
apr_accommodation = 209,
|
||||
may_accommodation = 209,
|
||||
jun_accommodation = 209,
|
||||
jul_accommodation = 209,
|
||||
aug_accommodation = 209,
|
||||
sep_accommodation = 209,
|
||||
oct_accommodation = 209,
|
||||
nov_accommodation = 209,
|
||||
dec_accommodation = 209,
|
||||
standard_accommodation = 209,
|
||||
currency = 'CAD'
|
||||
WHERE LOWER(city_name) = 'riga'
|
||||
`,
|
||||
[],
|
||||
(err) => {
|
||||
if (err) {
|
||||
console.error("❌ Error:", err);
|
||||
reject(err);
|
||||
} else {
|
||||
console.log("✅ Riga accommodation updated to CAD $209");
|
||||
resolve();
|
||||
}
|
||||
db.close();
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
updateRigaRate().catch(console.error);
|
||||
Reference in New Issue
Block a user