From cd56664442b25971ab1d1268930c522f73ec9309 Mon Sep 17 00:00:00 2001 From: counterweight Date: Sun, 9 Feb 2025 18:12:09 +0100 Subject: [PATCH] move database sync to database --- src/app.js | 6 ------ src/database.js | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app.js b/src/app.js index 6dd84ba..59d8ae9 100644 --- a/src/app.js +++ b/src/app.js @@ -5,12 +5,6 @@ const path = require('path'); const sequelize = require('./database'); const Session = require('./models/Session'); -sequelize.sync().then(() => { - console.log('Database synced'); -}).catch(err => { - console.error('Error syncing the database:', err); -}); - const app = express(); const port = 3000; diff --git a/src/database.js b/src/database.js index ec4715b..a7f0727 100644 --- a/src/database.js +++ b/src/database.js @@ -16,4 +16,10 @@ const sequelize = new Sequelize({ }, }); +sequelize.sync().then(() => { + console.log('Database synced'); +}).catch(err => { + console.error('Error syncing the database:', err); +}); + module.exports = sequelize; \ No newline at end of file