feat: set alter true while db sync

This commit is contained in:
amhsirak
2025-01-22 18:58:49 +05:30
parent 0abd8cb1d4
commit b1d15531e4

View File

@@ -29,7 +29,7 @@ export const connectDB = async () => {
export const syncDB = async () => {
try {
//setupAssociations();
await sequelize.sync({ force: false }); // 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!');
} catch (error) {
console.error('Failed to sync database:', error);