chore(ops): migrate clube67 to newwhats.clube67.com directory
continuous-integration/webhook Falha no deploy de clube67_newwhats.local (VPS 4)

This commit is contained in:
VPS 4 Deploy Agent
2026-05-18 03:26:41 +02:00
parent 298b1c64b0
commit 5ec6bd6354
576 changed files with 29016 additions and 235673 deletions
+40
View File
@@ -0,0 +1,40 @@
const mysql = require('mysql2/promise');
async function run() {
const c = await mysql.createConnection({
host: 'localhost', user: 'root', password: '', database: 'sis_odonto'
});
// 1. Seed missing plans (those referenced by existing procedimentos_valores_planos)
const plans = [
{ id: 'p2', nome: 'UNIMED ODONTO', tipo: 'Convenio', descontoPadrao: 0, corCartao: '#1eb545' },
{ id: 'p3', nome: 'ODONTOPREV', tipo: 'Convenio', descontoPadrao: 0, corCartao: '#0066cc' },
{ id: 'p4', nome: 'CASSEMS', tipo: 'Convenio', descontoPadrao: 0, corCartao: '#e63946' },
{ id: 'p5', nome: 'SESI ODONTO', tipo: 'Convenio', descontoPadrao: 0, corCartao: '#f4a261' },
];
for (const p of plans) {
await c.query(
'INSERT IGNORE INTO planos (id, nome, tipo, descontoPadrao, corCartao) VALUES (?, ?, ?, ?, ?)',
[p.id, p.nome, p.tipo, p.descontoPadrao, p.corCartao]
);
}
console.log('Plans seeded.');
// 2. Drop the FK on planoId to make the relation soft (plan can be deleted without cascading)
// This prevents the ER_NO_REFERENCED_ROW_2 on INSERT
try {
await c.query('ALTER TABLE procedimentos_valores_planos DROP FOREIGN KEY procedimentos_valores_planos_ibfk_2');
console.log('FK on planoId dropped — now soft reference.');
} catch (e) {
console.log('FK drop skipped (may already not exist):', e.message);
}
const [planos] = await c.query('SELECT id, nome, tipo FROM planos');
console.log('\n--- PLANOS FINAIS ---');
console.table(planos);
await c.end();
}
run().catch(console.error);