17 lines
533 B
JavaScript
17 lines
533 B
JavaScript
const { Pool } = require('pg');
|
|
const pool = new Pool({ connectionString: 'postgresql://edumanager:EduManager2026!Seguro@150.230.87.131:5432/edumanager' });
|
|
|
|
async function run() {
|
|
try {
|
|
console.log('Adicionando coluna "sexo" na tabela "alunos"...');
|
|
await pool.query('ALTER TABLE alunos ADD COLUMN IF NOT EXISTS sexo text;');
|
|
console.log('Coluna "sexo" adicionada ou já existente com sucesso!');
|
|
} catch (err) {
|
|
console.error('Erro ao adicionar coluna:', err);
|
|
} finally {
|
|
await pool.end();
|
|
}
|
|
}
|
|
|
|
run();
|