26 lines
708 B
JavaScript
26 lines
708 B
JavaScript
const { Pool } = require('pg');
|
|
|
|
const pool = new Pool({
|
|
user: 'enwelo_admin',
|
|
host: '87.106.21.21',
|
|
database: 'enwelo',
|
|
password: 'WX1t1cgP1qK09',
|
|
port: 5432,
|
|
ssl: false
|
|
});
|
|
|
|
async function run() {
|
|
try {
|
|
await pool.query('ALTER TABLE geodaten."potentialflächen_wind" ADD COLUMN IF NOT EXISTS planungsstand VARCHAR(255);');
|
|
console.log('Column planungsstand added successfully.');
|
|
|
|
const res = await pool.query("UPDATE geodaten.\"potentialflächen_wind\" SET planungsstand = 'rechtsverbindlich'");
|
|
console.log(`Updated ${res.rowCount} rows to rechtsverbindlich`);
|
|
} catch(e) {
|
|
console.error('Fehler:', e);
|
|
} finally {
|
|
await pool.end();
|
|
}
|
|
}
|
|
run();
|