The documentation for Sequelize states that sequelize.sync() shoudln't be used on production, as it is potentially destructive. Instead, migrations should be used.
Therefore, I am wondering what the best practices are for using sequelize.sync().
Is it common to use environment variables to check if the current environment is development? Like such:
if (process.env.NODE_ENV === 'development') {
sequelize.sync({ force: true });
}
That way, the database would only be synced in a development environment.
Otherwise, is it common this time to simply not use sync at all, even in a development environment, and use regular migrations?