Refactor: Renomeacao e modernizacao completa para Pedagog / PedagogIA
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
require('dotenv').config({ path: '/root/Apps/Camila/.env' });
|
||||
const { Pool } = require('pg');
|
||||
|
||||
const pool = new Pool({
|
||||
connectionString: process.env.DATABASE_URL
|
||||
});
|
||||
|
||||
async function migrate() {
|
||||
try {
|
||||
console.log("Conectando ao banco...");
|
||||
const cols = await pool.query(`
|
||||
SELECT column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema='escola' AND table_name='config';
|
||||
`);
|
||||
const colNames = cols.rows.map(r => r.column_name);
|
||||
console.log("Colunas atuais:", colNames);
|
||||
|
||||
if (colNames.includes('kemily_avatar_url')) {
|
||||
console.log("Renomeando kemily_avatar_url -> ia_avatar_url");
|
||||
await pool.query(`ALTER TABLE escola.config RENAME COLUMN kemily_avatar_url TO ia_avatar_url;`);
|
||||
}
|
||||
if (colNames.includes('camila_avatar_url')) {
|
||||
console.log("Renomeando camila_avatar_url -> user_avatar_url");
|
||||
await pool.query(`ALTER TABLE escola.config RENAME COLUMN camila_avatar_url TO user_avatar_url;`);
|
||||
}
|
||||
|
||||
await pool.query(`ALTER TABLE escola.config ALTER COLUMN agent_name SET DEFAULT 'PedagogIA';`);
|
||||
await pool.query(`ALTER TABLE escola.config ALTER COLUMN ia_avatar_url SET DEFAULT 'assets/pedagog_ia.png';`);
|
||||
await pool.query(`ALTER TABLE escola.config ALTER COLUMN user_avatar_url SET DEFAULT 'assets/pedagog_user.png';`);
|
||||
|
||||
await pool.query(`UPDATE escola.config SET agent_name = 'PedagogIA' WHERE agent_name = 'Kemily';`);
|
||||
await pool.query(`UPDATE escola.config SET ia_avatar_url = 'assets/pedagog_ia.png' WHERE ia_avatar_url = 'assets/kemily.png';`);
|
||||
await pool.query(`UPDATE escola.config SET user_avatar_url = 'assets/pedagog_user.png' WHERE user_avatar_url = 'assets/camila_prof.png';`);
|
||||
|
||||
console.log("Migração concluída com sucesso!");
|
||||
const updated = await pool.query(`SELECT * FROM escola.config;`);
|
||||
console.log("Configurações atualizadas:", updated.rows);
|
||||
} catch (err) {
|
||||
console.error("Erro na migração:", err);
|
||||
} finally {
|
||||
await pool.end();
|
||||
}
|
||||
}
|
||||
|
||||
migrate();
|
||||
+1
-1
@@ -62,7 +62,7 @@ async function test() {
|
||||
}).join('\n\n---\n\n');
|
||||
|
||||
const agentConfig = readAgentConfig();
|
||||
const agentName = agentConfig.agentName || "Kemily";
|
||||
const agentName = agentConfig.agentName || "PedagogIA";
|
||||
|
||||
const targetStudentInfo = `\nATENÇÃO CRÍTICA: A criança que está sendo avaliada e para quem você deve gerar o relatório individual é especificamente: "${crianca}". Todas as observações, avanços, preferências e conclusões descritas na PARTE 2 (Desenvolvimento Individual) devem referir-se exclusivamente a ${crianca}. Nunca confunda ${crianca} com outros colegas eventualmente citados nas observações (como Joãozinho, Vanderlei, etc.), e não atribua as ações deles a ela.\n`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user