{"id":24919319,"url":"https://github.com/nielsgl/sequelize-paper-trail","last_synced_at":"2026-02-24T13:02:12.058Z","repository":{"id":8271661,"uuid":"57168687","full_name":"nielsgl/sequelize-paper-trail","owner":"nielsgl","description":"Sequelize plugin for tracking revision history of model instances.","archived":false,"fork":false,"pushed_at":"2026-02-22T12:16:21.000Z","size":1578,"stargazers_count":95,"open_issues_count":46,"forks_count":64,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-02-22T17:17:11.233Z","etag":null,"topics":["javascript","mariadb","mysql","nodejs","papertrail","postgresql","revision","sequelize","sequelize-extension","sequelize-library","sequelize-paper-trail","sequelizejs","sqlite"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nielsgl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-26T23:26:33.000Z","updated_at":"2026-02-22T12:16:24.000Z","dependencies_parsed_at":"2023-01-11T18:46:20.769Z","dependency_job_id":null,"html_url":"https://github.com/nielsgl/sequelize-paper-trail","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/nielsgl/sequelize-paper-trail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielsgl%2Fsequelize-paper-trail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielsgl%2Fsequelize-paper-trail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielsgl%2Fsequelize-paper-trail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielsgl%2Fsequelize-paper-trail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nielsgl","download_url":"https://codeload.github.com/nielsgl/sequelize-paper-trail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nielsgl%2Fsequelize-paper-trail/sbom","scorecard":{"id":686510,"data":{"date":"2025-08-11","repo":{"name":"github.com/nielsgl/sequelize-paper-trail","commit":"9443b54492a4552163ba66744aa2be77910024d1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 3/22 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"83 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-4gxf-g5gf-22h4","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-56x4-j7p9-fcf9","Warn: Project is vulnerable to: GHSA-v78c-4p63-2j6c","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-px4h-xg32-q955","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4","Warn: Project is vulnerable to: GHSA-4p35-cfcx-8653","Warn: Project is vulnerable to: GHSA-7f3x-x4pr-wqhj","Warn: Project is vulnerable to: GHSA-jpp7-7chh-cf67","Warn: Project is vulnerable to: GHSA-q6wq-5p59-983w","Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2","Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-wrh9-cjv3-2hpw","Warn: Project is vulnerable to: GHSA-8c25-f3mj-v6h8","Warn: Project is vulnerable to: GHSA-vqfx-gj96-3w95","Warn: Project is vulnerable to: GHSA-f598-mfpv-gmfx","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-qgmg-gppg-76g5","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T01:00:42.006Z","repository_id":8271661,"created_at":"2025-08-22T01:00:42.006Z","updated_at":"2025-08-22T01:00:42.006Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29783615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T10:45:18.109Z","status":"ssl_error","status_checked_at":"2026-02-24T10:45:09.911Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","mariadb","mysql","nodejs","papertrail","postgresql","revision","sequelize","sequelize-extension","sequelize-library","sequelize-paper-trail","sequelizejs","sqlite"],"created_at":"2025-02-02T10:17:54.452Z","updated_at":"2026-02-24T13:02:12.051Z","avatar_url":"https://github.com/nielsgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sequelize Paper Trail\n\n\n\u003e 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.\n\n\n\n\u003c!-- [![NPM](https://nodei.co/npm/sequelize-paper-trail.png?downloads=true)](https://nodei.co/npm/sequelize-paper-trail/) --\u003e\n\n![Release Quality Gate](https://github.com/nielsgl/sequelize-paper-trail/actions/workflows/release.yml/badge.svg)\n[![npm-version](https://img.shields.io/npm/v/sequelize-paper-trail.svg)](https://www.npmjs.org/package/sequelize-paper-trail)\n[![node-version](https://img.shields.io/node/v/sequelize-paper-trail.svg)](https://www.npmjs.org/package/sequelize-paper-trail)\n[![npm-downloads-monthly](https://img.shields.io/npm/dm/sequelize-paper-trail.svg)](https://www.npmjs.org/package/sequelize-paper-trail)\n[![npm-downloads-total](https://img.shields.io/npm/dt/sequelize-paper-trail.svg)](https://www.npmjs.org/package/sequelize-paper-trail)\n[![license](https://img.shields.io/npm/l/sequelize-paper-trail.svg)](https://github.com/nielsgl/sequelize-paper-trail/blob/main/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/nielsgl/sequelize-paper-trail.svg)](https://www.npmjs.org/package/sequelize-paper-trail)\n[![GitHub tag](https://img.shields.io/github/tag/nielsgl/sequelize-paper-trail.svg)](https://www.npmjs.org/package/sequelize-paper-trail)\n[![GitHub commits](https://img.shields.io/github/commits-since/nielsgl/sequelize-paper-trail/1.2.0.svg)]()\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Examples (Current Version)](#examples-current-version)\n  - [Example](#example)\n- [User Tracking](#user-tracking)\n- [Disable logging for a single call](#disable-logging-for-a-single-call)\n- [Options](#options)\n  - [Default options](#default-options)\n  - [Options documentation](#options-documentation)\n- [Limitations](#limitations)\n- [Testing](#testing)\n- [Documentation Map](#documentation-map)\n- [Support](#support)\n  - [Supported Versions](#supported-versions)\n- [Contributing](#contributing)\n- [Author](#author)\n- [Thanks](#thanks)\n- [Links](#links)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n\n```bash\nnpm install --save sequelize-paper-trail\n# or with yarn:\n# yarn add sequelize-paper-trail\n```\n\n## Usage\n\nSequelize Paper Trail assumes that you already set up your Sequelize connection, for example, like this:\n```javascript\nconst Sequelize = require('sequelize');\nconst sequelize = new Sequelize('database', 'username', 'password');\n```\n\nthen adding Sequelize Paper Trail is as easy as:\n\n```javascript\nconst PaperTrail = require('sequelize-paper-trail').init(sequelize, options);\nPaperTrail.defineModels();\n```\n\nwhich loads the Paper Trail library, and the `defineModels()` method sets up a `Revisions` and `RevisionHistory` table.\n\n*Note: If you pass `userModel` option to `init` in order to enable user tracking, `userModel` should be setup before `defineModels()` is called.*\n\nThen for each model that you want to keep a paper trail you simply add:\n\n```javascript\nModel.hasPaperTrail();\n```\n\n`hasPaperTrail` returns the `hasMany` association to the `revisionModel` so you can keep track of the association for reference later.\n\n## Examples (Current Version)\n\nThe current example for this line lives in `examples/v3`. The folder contains a runnable SQLite app that prints revisions and revision changes.\n\n```bash\ncd examples/v3\nnpm install\nnpm run start\n```\n\nFor the full archive (v3/v4/v5), see `examples/README.md`.\n\n### Example\n\n```javascript\nconst Sequelize = require('sequelize');\nconst sequelize = new Sequelize('database', 'username', 'password');\n\nconst PaperTrail = require('sequelize-paper-trail').init(sequelize, options || {});\nPaperTrail.defineModels();\n\nconst User = sequelize.define('User', {\n  username: Sequelize.STRING,\n  birthday: Sequelize.DATE\n});\n\nUser.Revisions = User.hasPaperTrail();\n```\n\n## User Tracking\n\nThere are 2 steps to enable user tracking, ie, recording the user who created a particular revision.\n1. Enable user tracking by passing `userModel` option to `init`, with the name of the model which stores users in your application as the value.\n\n```javascript\nconst options = {\n  /* ... */\n  userModel: 'user',\n};\n```\n2. Pass the id of the user who is responsible for the database operation to `sequelize-paper-trail` either by sequelize options or by using CLS context.\n\n```javascript\nModel.update({\n  /* ... */\n}, {\n  userId: user.id\n}).then(() {\n  /* ... */\n});\n```\nOR\n\n```javascript\nconst cls = require('cls-hooked');\nconst session = cls.createNamespace('my session');\n\nsession.set('userId', user.id);\n\nModel.update({\n  /* ... */\n}).then(() {\n  /* ... */\n});\n\n```\n\nTo enable CLS, set `continuationNamespace` in initialization options.\n\n- Sequelize v6: use `cls-hooked` (required for CLS path).\n- Sequelize v5: legacy `continuation-local-storage` still works; you can opt into `cls-hooked` by setting `SEQUELIZE_CLS=cls-hooked`.\n\nYou may also have to call `.run()` or `.bind()` on your CLS namespace depending on your framework integration.\n\n## Disable logging for a single call\n\nTo not log a specific change to a revisioned object, just pass a `noPaperTrail` with a truthy (true, 1, ' ') value.\n\n```javascript\nconst instance = await Model.findOne();\ninstance.update({ noPaperTrail: true }).then(() {\n  /* ... */\n});\n```\n\n## Options\n\nPaper Trail supports various options that can be passed into the initialization. The following are the default options:\n\n### Default options\n\n```javascript\n// Default options\nconst options = {\n  exclude: [\n    'id',\n    'createdAt',\n    'updatedAt',\n    'deletedAt',\n    'created_at',\n    'updated_at',\n    'deleted_at'\n  ],\n  revisionAttribute: 'revision',\n  revisionModel: 'Revision',\n  revisionChangeModel: 'RevisionChange',\n  enableRevisionChangeModel: false,\n  UUID: false,\n  underscored: false,\n  underscoredAttributes: false,\n  defaultAttributes: {\n    documentId: 'documentId',\n    revisionId: 'revisionId'\n  },\n  enableCompression: false,\n  enableMigration: false,\n  enableStrictDiff: true,\n  continuationKey: 'userId',\n  belongsToUserOptions: undefined,\n  metaDataFields: undefined,\n  metaDataContinuationKey: 'metaData'\n};\n```\n\n### Options documentation\n\n| Option                      | Type    | Default Value                                                                                                        | Description                                                                                                                                                                                                            |\n| --------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [debug]                     | Boolean | false                                                                                                                | Enables logging to the console.                                                                                                                                                                                        |\n| [exclude]                   | Array   | ['id', 'createdAt', 'updatedAt', 'deletedAt', 'created_at', 'updated_at', 'deleted_at', [options.revisionAttribute]] | Array of global attributes to exclude from the paper trail.                                                                                                                                                            |\n| [revisionAttribute]         | String  | 'revision'                                                                                                           | Name of the attribute in the table that corresponds to the current revision.                                                                                                                                           |\n| [revisionModel]             | String  | 'Revision'                                                                                                           | Name of the model that keeps the revision models.                                                                                                                                                                      |\n| [tableName]                 | String  | undefined                                                                                                            | Name of the table that keeps the revision models. Passed to Sequelize. Necessary in Sequelize 5+ when underscored is true and the table is camelCase or PascalCase.                                                    |\n| [revisionChangeModel]       | String  | 'RevisionChange'                                                                                                     | Name of the model that tracks all the attributes that have changed during each create and update call.                                                                                                                 |\n| [enableRevisionChangeModel] | Boolean | false                                                                                                                | Disable the revision change model to save space.                                                                                                                                                                       |\n| [UUID]                      | Boolean | false                                                                                                                | The [revisionModel] has id attribute of type UUID for postgresql.                                                                                                                                                      |\n| [underscored]               | Boolean | false                                                                                                                | The [revisionModel] and [revisionChangeModel] have 'createdAt' and 'updatedAt' attributes, by default, setting this option to true changes it to 'created_at' and 'updated_at'.                                        |\n| [underscoredAttributes]     | Boolean | false                                                                                                                | The [revisionModel] has a [defaultAttribute] 'documentId', and the [revisionChangeModel] has a  [defaultAttribute] 'revisionId, by default, setting this option to true changes it to 'document_id' and 'revision_id'. |\n| [defaultAttributes]         | Object  | { documentId: 'documentId', revisionId: 'revisionId' }                                                               |                                                                                                                                                                                                                        |\n| [userModel]                 | String  |                                                                                                                      | Name of the model that stores users in your.                                                                                                                                                                           |\n| [enableCompression]         | Boolean | false                                                                                                                | Compresses the revision attribute in the [revisionModel] to only the diff instead of all model attributes.                                                                                                             |\n| [enableMigration]           | Boolean | false                                                                                                                | Automatically adds the [revisionAttribute] via a migration to the models that have paper trails enabled.                                                                                                               |\n| [enableStrictDiff]          | Boolean | true                                                                                                                 | Reports integers and strings as different, e.g. `3.14` !== `'3.14'`                                                                                                                                                    |\n| [continuationNamespace]     | String  |                                                                                                                      | Name of the CLS namespace used for user attribution (`cls-hooked` for v6; legacy CLS path for v5).                                                                                                                   |\n| [continuationKey]           | String  | 'userId'                                                                                                             | The CLS key that contains the user id.                                                                                                                                                                                 |\n| [belongsToUserOptions]      | Object  | undefined                                                                                                            | The options used for belongsTo between userModel and Revision model                                                                                                                                                    |\n| [metaDataFields]            | Object  | undefined                                                                                                            | The keys that will be provided in the meta data object. { key: isRequired (boolean)} format. Can be used to privovide additional fields - other associations, dates, etc to the Revision model                         |\n| [metaDataContinuationKey]   | String  | 'metaData'                                                                                                           | The CLS key that contains the meta data object, from where the metaDataFields are extracted.                                                                                                                          |\n\n## Limitations\n\n* This project does not support models with composite primary keys. You can work around using a unique index with multiple fields.\n\n## Testing\n\nThe tests are designed to run on SQLite3 in-memory tables, built from Sequelize migration files. If you want to actually generate a database file, change the storage option to a filename and run the tests.\n\n```bash\nnpm install\nnpm test\n```\n\nNotes:\n- Node.js **20.20.0** (recommended dev baseline) or any active LTS **\u003e=20** is required for development.\n- npm is the canonical package manager for this repo.\n\n## Documentation Map\n\nCore references:\n- `RELEASE-POLICY.md`: authoritative release/support policy (branches, deprecations, gates).\n- `docs/PROJECT.md`: product and runtime reference (behavior, structure, scripts).\n- `docs/PLAN.md`: execution-order overview for active milestones.\n- `docs/INDEX.md`: canonical PRD index, priorities, and execution waves.\n- `docs/STATUS.md`: runtime WI board (`Backlog`, `In Progress`, `Blocked`, `Done`).\n- `docs/impl/README.md`: implementation-plan format and Plan/Ship gate lifecycle.\n- `docs/TESTS.md`: test strategy + coverage expectations.\n- `docs/CI.md`: CI workflows and required gates.\n- `docs/MIGRATION.md`: living migration guide for maintainers and users.\n- `docs/RELEASE-CHECKLIST.md`: reusable checklist for releases.\n- `examples/README.md`: index of runnable example apps for each support line.\n\nTracked PRDs (current + deferred):\n- `docs/prd/PRD-001-release-v3-1-0.md`: v3.1.0 release PRD (legacy line + Node\u003c20 deprecation).\n- `docs/prd/PRD-002-release-v4-0-0.md`: v4.0.0 release PRD (bridge line).\n- `docs/prd/PRD-003-deep-diff-replacement.md`: deep-diff removal plan (no behavior drift).\n- `docs/prd/PRD-004-tooling-major-review.md`: tooling-major review backlog (Jest/ESLint/Prettier).\n- `docs/prd/PRD-005-release-v5-0-0.md`: v5.0.0 release PRD (feature line release execution).\n\nPRD index:\n- `docs/INDEX.md`: ordered execution plan from PRD wave selection down to WI ordering.\n\nArchived PRDs (historical context):\n- `docs/archive/`: completed phase PRDs and demo PRDs preserved for reference.\n\nLegacy pointers (safe to ignore; kept for continuity):\n- `docs/release_checklist_phase5.md`: pointer to `docs/RELEASE-CHECKLIST.md`.\n- `docs/migration_phase5.md`: pointer to `docs/MIGRATION.md`.\n\n## Support\n\nPlease use:\n* GitHub's [issue tracker](https://github.com/nielsgl/sequelize-paper-trail/issues)\n* Migration guide: see `docs/MIGRATION.md` for the in-place upgrade path (CLS, metadata, adapter overrides)\n\n### Supported Versions\n\nThe library is verified against Sequelize **v5** (current baseline) and **v6.37.7**. Release-quality checks include `npm test -- --coverage`, `npm run test:v6` (required for `main`, `feature/next`, and `release/v4`), and demo snapshot parity for baseline/v5/v6.\n\nSupport lines:\n- **v3.x**: hotfix-only line (critical fixes only).\n- **v4.x**: bugfix-only bridge supporting Sequelize v5 + v6, Node \u003e=20.\n- **v5.x**: feature line; Sequelize v6 primary, v7 experimental later.\n\n#### v4 Bridge Contract (What is guaranteed)\n\n| Area | v4 Guarantee | Notes |\n| --- | --- | --- |\n| Node runtime | `\u003e=20` required | `init()` throws `ERR_UNSUPPORTED_NODE_VERSION` for `\u003c20` or unknown/malformed metadata. |\n| Sequelize adapters | `^5` and `^6` supported | v4 bridge is the compatibility line before v5 feature-line adoption. |\n| Change scope | Bugfix-only | No new features or semantic-expansion work in v4 releases. |\n| CLS behavior | Supported for v5/v6 paths | `cls-hooked` is required for Sequelize v6 CLS usage. |\n\n#### v3 -\u003e v4 Upgrade Outcomes\n\n- Runtime expectation changes from warning to hard enforcement for Node version support.\n- Application teams should validate both default and CLS-enabled write paths before cutting over.\n- Maintainers should align support policy, migration guidance, and release notes before publishing the v4 bridge release.\n\nNode versions **\u003c20** are unsupported on the v4 line. `init()` now throws `ERR_UNSUPPORTED_NODE_VERSION` for Node \u003c20 or unknown/malformed Node runtime metadata. `SUPPRESS_NODE_DEPRECATION` no longer bypasses runtime enforcement in v4.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Install dependencies with `npm install`\n4. Commit your changes (`git commit -am 'Added some feature'`)\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create new Pull Request\n\n## Author\n\n© [Niels van Galen Last](https://nielsgl.com) – [@nielsgl](https://twitter.com/nielsgl) – nvangalenlast@gmail.com\nDistributed under the MIT license. See ``LICENSE`` for more information.\n[https://github.com/nielsgl/sequelize-paper-trail](https://github.com/nielsgl/)\n\n## Thanks\n\nThis project was inspired by:\n* [Sequelize-Revisions](https://github.com/bkniffler/sequelize-revisions)\n* [Paper Trail](https://github.com/airblade/paper_trail)\n\nContributors:\n [https://github.com/nielsgl/sequelize-paper-trail/graphs/contributors](https://github.com/nielsgl/sequelize-paper-trail/graphs/contributors)\n\n## Links\n* [Example application](https://github.com/nielsgl/sequelize-paper-trail-example)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnielsgl%2Fsequelize-paper-trail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnielsgl%2Fsequelize-paper-trail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnielsgl%2Fsequelize-paper-trail/lists"}