nielsgl / sequelize-paper-trail

Sequelize plugin for tracking revision history of model instances.
MIT License
95 stars 69 forks source link

Revisions table breaks with Sequelize 5. #82

Open createthis opened 5 years ago

createthis commented 5 years ago

This appears to be related to https://github.com/sequelize/sequelize/issues/10717

If the revisionModel is Revisions, sequelize 5 has a bug and lowercases the table name as revisions in queries. This breaks sequelize-paper-trail.

I've found two potential solutions both added on https://github.com/nielsgl/sequelize-paper-trail/blob/a0f0b6aa4fdfdf1cd6d93f43ca49850dec566a44/lib/index.js#L637

  1. add freezeTableName: true,
  2. add tableName: options.tableName,
createthis commented 5 years ago

@nielsgl ^