Files
notas-api/src/initDB.js
T
Marcos d73e1b2ddd
Despliegue Automático / desplegar (push) Successful in 53s
Remove username to email migration logic from initDB function
2026-07-28 18:44:02 +02:00

16 lines
422 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const sequelize = require('./config/database');
async function initDB() {
try {
await sequelize.sync({ alter: true });
console.log('✅ Base de datos conectada y tablas sincronizadas.');
// console.log('️ Creación de usuario por defecto desactivada.');
} catch (error) {
console.error('❌ Error fatal al iniciar la base de datos:', error);
process.exit(1);
}
}
module.exports = initDB;