mirror of
https://github.com/mblanke/Gov_Travel_App.git
synced 2026-03-01 06:00:21 -05:00
- 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.
39 lines
895 B
JavaScript
39 lines
895 B
JavaScript
const Database = require("better-sqlite3");
|
|
const sourceDb = new Database("data/travel_rates_scraped.sqlite3");
|
|
|
|
// Check schema
|
|
console.log("\n=== ACCOMMODATIONS SCHEMA ===");
|
|
const accomSchema = sourceDb
|
|
.prepare(
|
|
"SELECT sql FROM sqlite_master WHERE type='table' AND name='accommodations'"
|
|
)
|
|
.get();
|
|
console.log(accomSchema.sql);
|
|
|
|
// Get Latvia data
|
|
console.log("\n=== LATVIA ACCOMMODATIONS ===");
|
|
const latvia = sourceDb
|
|
.prepare(
|
|
`
|
|
SELECT * FROM accommodations
|
|
WHERE source_url LIKE '%Latvia%' OR raw_json LIKE '%Latvia%'
|
|
LIMIT 5
|
|
`
|
|
)
|
|
.all();
|
|
console.log(JSON.stringify(latvia, null, 2));
|
|
|
|
// Search for Riga specifically
|
|
console.log("\n=== RIGA SEARCH ===");
|
|
const riga = sourceDb
|
|
.prepare(
|
|
`
|
|
SELECT * FROM accommodations
|
|
WHERE city LIKE '%Riga%' OR raw_json LIKE '%Riga%'
|
|
`
|
|
)
|
|
.all();
|
|
console.log(JSON.stringify(riga, null, 2));
|
|
|
|
sourceDb.close();
|