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:
44
scripts/debug/list-tables.ts
Normal file
44
scripts/debug/list-tables.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { Pool } from 'pg';
|
||||
import * as dotenv from 'dotenv';
|
||||
import * as path from 'path';
|
||||
|
||||
// Load .env.local first (takes precedence), then .env
|
||||
dotenv.config({ path: path.resolve(process.cwd(), '.env.local') });
|
||||
dotenv.config({ path: path.resolve(process.cwd(), '.env') });
|
||||
|
||||
const pool = new Pool({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
});
|
||||
|
||||
async function listTables() {
|
||||
try {
|
||||
console.log('Connecting to database...');
|
||||
console.log('DATABASE_URL:', process.env.DATABASE_URL?.replace(/:[^:@]+@/, ':****@'));
|
||||
|
||||
// List all tables
|
||||
const result = await pool.query(`
|
||||
SELECT table_name
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'public'
|
||||
ORDER BY table_name;
|
||||
`);
|
||||
|
||||
console.log('\n=== Tables in Database ===');
|
||||
if (result.rows.length === 0) {
|
||||
console.log('No tables found!');
|
||||
} else {
|
||||
result.rows.forEach((row) => {
|
||||
console.log(`- ${row.table_name}`);
|
||||
});
|
||||
}
|
||||
|
||||
console.log(`\nTotal: ${result.rows.length} tables`);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error listing tables:', error);
|
||||
} finally {
|
||||
await pool.end();
|
||||
}
|
||||
}
|
||||
|
||||
listTables();
|
||||
Reference in New Issue
Block a user