- Add backend stale process monitoring API (/api/stale-processes) - Add users management route - Add frontend landing page and stale process monitor UI on /scraper-tools - Move old development scripts to backend/archive/ - Update frontend build with new features 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import { Pool } from 'pg';
|
|
|
|
const pool = new Pool({
|
|
connectionString: 'postgresql://sail:password@localhost:5432/dutchie_menus'
|
|
});
|
|
|
|
async function addLocationColumns() {
|
|
try {
|
|
console.log('Adding location columns to proxies table...\n');
|
|
|
|
await pool.query(`
|
|
ALTER TABLE proxies
|
|
ADD COLUMN IF NOT EXISTS city VARCHAR(100),
|
|
ADD COLUMN IF NOT EXISTS state VARCHAR(100),
|
|
ADD COLUMN IF NOT EXISTS country VARCHAR(100),
|
|
ADD COLUMN IF NOT EXISTS country_code VARCHAR(10),
|
|
ADD COLUMN IF NOT EXISTS latitude DECIMAL(10, 8),
|
|
ADD COLUMN IF NOT EXISTS longitude DECIMAL(11, 8)
|
|
`);
|
|
|
|
console.log('✅ Location columns added successfully\n');
|
|
|
|
// Show updated schema
|
|
const result = await pool.query(`
|
|
SELECT column_name, data_type
|
|
FROM information_schema.columns
|
|
WHERE table_name = 'proxies'
|
|
ORDER BY ordinal_position
|
|
`);
|
|
|
|
console.log('Updated proxies table schema:');
|
|
console.log('─'.repeat(60));
|
|
result.rows.forEach(row => {
|
|
console.log(` ${row.column_name}: ${row.data_type}`);
|
|
});
|
|
console.log('─'.repeat(60));
|
|
|
|
} catch (error: any) {
|
|
console.error('Error:', error.message);
|
|
} finally {
|
|
await pool.end();
|
|
}
|
|
}
|
|
|
|
addLocationColumns();
|