Remove alter param from database sync

Re: [sequelize docs](https://sequelize.org/docs/v6/core-concepts/model-basics/#synchronization-in-production)
Alter is a bad idea in production.

Also print error message instead of sequelize error object as it's a bit verbose
This commit is contained in:
funkecoder23
2024-02-04 23:23:57 -05:00
parent c7aa5732a9
commit ecdae702ad

View File

@@ -185,9 +185,9 @@ Subtitle.belongsTo(File, { foreignKey: 'fileId', constraints: false });
export function connect() { export function connect() {
if (databaseConfig.ENABLE_SYNC) { if (databaseConfig.ENABLE_SYNC) {
return database.sync({ alter: true }) return database.sync()
.catch(error => { .catch(error => {
console.error('Failed syncing database: ', error); console.error('Failed syncing database: ', error.message);
throw error; throw error;
}); });
} }