feat: check node env
This commit is contained in:
@@ -29,6 +29,7 @@ export const connectDB = async () => {
|
|||||||
export const syncDB = async () => {
|
export const syncDB = async () => {
|
||||||
try {
|
try {
|
||||||
//setupAssociations();
|
//setupAssociations();
|
||||||
|
const isDevelopment = process.env.NODE_ENV === 'development';
|
||||||
await sequelize.sync({ force: false, alter: true }); // force: true will drop and recreate tables on every run
|
await sequelize.sync({ force: false, alter: true }); // force: true will drop and recreate tables on every run
|
||||||
console.log('Database synced successfully!');
|
console.log('Database synced successfully!');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user