24 lines
597 B
JavaScript
24 lines
597 B
JavaScript
const { Pool } = require('pg');
|
|
|
|
const pool = new Pool({
|
|
connectionString: 'postgresql://edumanager:EduManager2026!Seguro@150.230.87.131:5432/edumanager'
|
|
});
|
|
|
|
async function run() {
|
|
const client = await pool.connect();
|
|
try {
|
|
await client.query(`
|
|
ALTER TABLE prematricula_config
|
|
ADD COLUMN IF NOT EXISTS turmas_permitidas TEXT[] DEFAULT '{}';
|
|
`);
|
|
console.log('✅ Coluna turmas_permitidas adicionada com sucesso!');
|
|
} catch (e) {
|
|
console.error('❌ Erro ao adicionar coluna:', e.message);
|
|
} finally {
|
|
client.release();
|
|
await pool.end();
|
|
}
|
|
}
|
|
|
|
run();
|