Include complete API and frontend sources for unified deployment
This commit is contained in:
1 parent
627b0ae60e
commit
d8fcae32b0
93 files changed
+53270
-3
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import { models, sequelize } from '../models/index.js';
|
||||
import setupAssociations from '../models/setupAssociations.js';
|
||||
|
||||
export async function initializeDbModels() {
|
||||
for (const model of Object.values(models)) if (typeof model.initialize === 'function') model.initialize(sequelize);
|
||||
setupAssociations();
|
||||
for (const model of Object.values(models)) await model.sync({ alter: true });
|
||||
if (process.env.NODE_ENV !== 'test') console.log('models initialized');
|
||||
}
|
||||
Reference in new issue
Block a user