Réorganisation des sources

This commit is contained in:
Rampeur
2025-08-15 17:29:23 +02:00
parent bd3d1ade49
commit ea2d177c4c
29 changed files with 199 additions and 190 deletions
-23
View File
@@ -1,23 +0,0 @@
const DB = require('../database');
const sequelize = require('../database/config/sequelize');
const associate = require('../database/relationships');
// Connect to the database and log a message to the console
const connectDB = async () => {
try {
await sequelize.authenticate();
console.log('Connection has been established successfully🔥');
// Synchronize the database with the models without need of dropping the tables
await DB.sequelize.sync({
force: false,
});
associate(); // Call the associate function to create the relationships between the models
} catch (error) {
console.error('Unable to connect to the database:', error);
process.exit(1); // Exit the process if the connection is not successful
}
};
module.exports = connectDB;