- 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>
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { pool } from './src/db/migrate.js';
|
|
|
|
async function main() {
|
|
const result = await pool.query(`
|
|
SELECT column_name, data_type, is_nullable
|
|
FROM information_schema.columns
|
|
WHERE table_name = 'products'
|
|
ORDER BY ordinal_position;
|
|
`);
|
|
|
|
console.log('Products table columns:');
|
|
result.rows.forEach(row => {
|
|
console.log(` ${row.column_name}: ${row.data_type} (${row.is_nullable === 'YES' ? 'nullable' : 'NOT NULL'})`);
|
|
});
|
|
|
|
const constraints = await pool.query(`
|
|
SELECT constraint_name, constraint_type
|
|
FROM information_schema.table_constraints
|
|
WHERE table_name = 'products';
|
|
`);
|
|
|
|
console.log('\nProducts table constraints:');
|
|
constraints.rows.forEach(row => {
|
|
console.log(` ${row.constraint_name}: ${row.constraint_type}`);
|
|
});
|
|
|
|
// Get unique constraints details
|
|
const uniqueConstraints = await pool.query(`
|
|
SELECT
|
|
tc.constraint_name,
|
|
kcu.column_name
|
|
FROM information_schema.table_constraints tc
|
|
JOIN information_schema.key_column_usage kcu
|
|
ON tc.constraint_name = kcu.constraint_name
|
|
WHERE tc.table_name = 'products'
|
|
AND tc.constraint_type IN ('PRIMARY KEY', 'UNIQUE');
|
|
`);
|
|
|
|
console.log('\nUnique/Primary key constraints:');
|
|
uniqueConstraints.rows.forEach(row => {
|
|
console.log(` ${row.constraint_name}: ${row.column_name}`);
|
|
});
|
|
|
|
await pool.end();
|
|
}
|
|
|
|
main().catch(console.error);
|