From 413e9cacf785b8fb9dc9ebcd081b9f12ec1cdcf0 Mon Sep 17 00:00:00 2001 From: Nareshkumar Rao Date: Wed, 28 Jul 2021 20:54:44 +0200 Subject: [PATCH] lil rearrange --- src/db/db.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/db/db.js b/src/db/db.js index f0c1242..f65f7cd 100644 --- a/src/db/db.js +++ b/src/db/db.js @@ -40,7 +40,6 @@ const store = new SequelizeStore({ db: storeDB, expiration: process.env.COOKIE_EXPIRY_DURATION, }); -store.sync(); const Contact = sequelize.define("Contact", { user: { @@ -52,7 +51,7 @@ const Contact = sequelize.define("Contact", { allowNull: false, }, }); -Contact.sync(); + const User = sequelize.define("User", { telegram: { @@ -65,6 +64,8 @@ const User = sequelize.define("User", { }, }); +Contact.sync(); + User.sync().then(() => { if (process.env.ADMIN_USERNAME && process.env.ADMIN_PASSWORD) { User.create({ @@ -75,6 +76,8 @@ User.sync().then(() => { } }); +store.sync(); + exports.User = User; exports.Contact = Contact; exports.sequelize = sequelize;