mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
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:
@@ -1,7 +1,7 @@
|
||||
import moment from 'moment';
|
||||
import { Sequelize, Op, DataTypes, fn, col, literal } from 'sequelize';
|
||||
import { databaseConfig } from './config.js';
|
||||
import {logger} from "./logger.js";
|
||||
import { logger } from "./logger.js";
|
||||
import * as Promises from './promises.js';
|
||||
|
||||
const database = new Sequelize(
|
||||
@@ -185,9 +185,9 @@ Subtitle.belongsTo(File, { foreignKey: 'fileId', constraints: false });
|
||||
|
||||
export function connect() {
|
||||
if (databaseConfig.ENABLE_SYNC) {
|
||||
return database.sync({ alter: true })
|
||||
return database.sync()
|
||||
.catch(error => {
|
||||
console.error('Failed syncing database: ', error);
|
||||
console.error('Failed syncing database: ', error.message);
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user