{"repo":"nielsgl/sequelize-paper-trail","free":true,"listed":false,"github":"https://github.com/nielsgl/sequelize-paper-trail","clone":"git clone https://github.com/nielsgl/sequelize-paper-trail.git","description":"Sequelize plugin for tracking revision history of model instances.","language":"JavaScript","stars":96,"topics":["sequelize","sequelize-paper-trail","papertrail","revision","sequelizejs","sequelize-extension","sequelize-library","nodejs","javascript","mysql"],"license":"MIT","category":"databases-storage","readme_excerpt":"Sequelize Paper Trail Track changes to your models, for auditing or versioning. See how a model looked at any stage in its lifecycle, revert it to any version, or restore it after it has been destroyed. Record the user who created the version. Table of Contents - Installation - Usage - Examples (Current Version) - Example - User Tracking - Disable logging for a single call - Options - Default options - Options documentation - Limitations - Testing - Documentation Map - Support - Supported Versions - Contributing - Author - Thanks - Links Installation Usage Sequelize Paper Trail assumes that you already set up your Sequelize connection, for example, like this: then adding Sequelize Paper Trail is as easy as: which loads the Paper Trail library, and the defineModels() method sets up a Revisions and RevisionHistory table. Note: If you pass userModel option to init in order to enable user tracking, userModel should be setup before defineModels() is called. Then for each model that you want to keep a paper trail you simply add: hasPaperTrail returns the hasMany association to the revisionModel so you can keep track of the association for reference later. Examples (Current Version) The current example for this line lives in examples/v3 . The folder contains a runnable SQLite app that prints revisions and revision changes. For the full archive (v3/v4/v5), see examples/README.md . Example User Tracking There are 2 steps to enable user tracking, ie, recording the user who created a pa","default_branch":null,"files":null,"tree":[],"storefront":"/r/nielsgl","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/nielsgl/sequelize-paper-trail/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}