const { Client } = require('pg');

async function clean() {
    const client = new Client({
        host: '87.106.21.21',
        port: 5432,
        user: 'enwelo_admin',
        password: 'WX1t1cgP1qK09',
        database: 'enwelo'
    });
    
    try {
        await client.connect();
        console.log("Cleaning up test entries...");
        const res = await client.query("DELETE FROM geodaten.wea_standorte WHERE projekt_id LIKE '%Test%' OR wea_nummer = 'TEST-1'");
        console.log(`Cleaned ${res.rowCount} rows.`);
    } catch (e) {
        console.error("Error:", e);
    } finally {
        await client.end();
    }
}
clean();
