chore: sync with Gitea master and restore local-only files
Reset local main to gitea/master (new source of truth) and restored local-only files: web scrapers, admin dashboard, ChromaDB integration, debug scripts, and utility libraries that aren't tracked in Gitea. Gitea master adds: discovermass, buscarmisas-network, hk-parishes, bohosluzby, kerknet, gottesdienstzeiten, miserend importers, ClaimRequest model, forward geocoding, heartbeat healthcheck. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
47
scripts/debug/compare-schemas.ts
Normal file
47
scripts/debug/compare-schemas.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { Pool } from 'pg';
|
||||
|
||||
async function getColumns(pool: Pool, table: string) {
|
||||
const result = await pool.query(
|
||||
`SELECT column_name, data_type FROM information_schema.columns WHERE table_name = $1 ORDER BY ordinal_position`,
|
||||
[table]
|
||||
);
|
||||
return result.rows;
|
||||
}
|
||||
|
||||
async function run() {
|
||||
const nas = new Pool({ connectionString: 'postgresql://postgres:postgres@192.168.0.145:5434/nearestmass' });
|
||||
const neon = new Pool({
|
||||
connectionString: 'postgresql://neondb_owner:npg_sX8dxFg9KZIR@ep-plain-sky-ah15xa97-pooler.c-3.us-east-1.aws.neon.tech/neondb?sslmode=require',
|
||||
ssl: { rejectUnauthorized: false },
|
||||
});
|
||||
|
||||
for (const table of ['churches', 'mass_schedules', 'confession_schedules', 'adoration_schedules']) {
|
||||
const nasCols = await getColumns(nas, table);
|
||||
const neonCols = await getColumns(neon, table);
|
||||
|
||||
const nasNames = new Set(nasCols.map((c) => c.column_name));
|
||||
const neonNames = new Set(neonCols.map((c) => c.column_name));
|
||||
|
||||
const onlyNas = nasCols.filter((c) => !neonNames.has(c.column_name));
|
||||
const onlyNeon = neonCols.filter((c) => !nasNames.has(c.column_name));
|
||||
|
||||
if (onlyNas.length > 0 || onlyNeon.length > 0) {
|
||||
console.log(`\n=== ${table} ===`);
|
||||
if (onlyNas.length) {
|
||||
console.log(' NAS only:');
|
||||
for (const c of onlyNas) console.log(` - ${c.column_name} (${c.data_type})`);
|
||||
}
|
||||
if (onlyNeon.length) {
|
||||
console.log(' Neon only:');
|
||||
for (const c of onlyNeon) console.log(` - ${c.column_name} (${c.data_type})`);
|
||||
}
|
||||
} else {
|
||||
console.log(`\n=== ${table} === (schemas match)`);
|
||||
}
|
||||
}
|
||||
|
||||
await nas.end();
|
||||
await neon.end();
|
||||
}
|
||||
|
||||
run();
|
||||
Reference in New Issue
Block a user