chore: notes on db sync in dev mode

This commit is contained in:
amhsirak
2025-01-22 19:02:22 +05:30
parent aaf13b4700
commit a4c072b7d5

View File

@@ -31,6 +31,7 @@ export const syncDB = async () => {
//setupAssociations(); //setupAssociations();
const isDevelopment = process.env.NODE_ENV === 'development'; const isDevelopment = process.env.NODE_ENV === 'development';
// force: true will drop and recreate tables on every run // force: true will drop and recreate tables on every run
// Use `alter: true` only in development mode
await sequelize.sync({ await sequelize.sync({
force: false, force: false,
alter: isDevelopment alter: isDevelopment