Giter Site home page Giter Site logo

Comments (11)

sdepold avatar sdepold commented on May 3, 2024

sounds good.

from sequelize.

Trakkasure avatar Trakkasure commented on May 3, 2024

I have this feature completed.
New option: trackChanges
If set to true, a new table for the existing table is created: tablename_history

A field "updatedAt" keeps track of when the table was updated from the historical value.

from sequelize.

Trakkasure avatar Trakkasure commented on May 3, 2024

I have all of these features committed in my fork. Is there some thing can do to get you a copy?

from sequelize.

sdepold avatar sdepold commented on May 3, 2024

when u access the website of your forked repo there is a button named "send pull request" or smth like that :)

from sequelize.

Trakkasure avatar Trakkasure commented on May 3, 2024

Pull request sent.

from sequelize.

faceleg avatar faceleg commented on May 3, 2024

Hate to resurrect this issue, but was the PR successful?

from sequelize.

mickhansen avatar mickhansen commented on May 3, 2024

@faceleg i don't believe so.

from sequelize.

janmeier avatar janmeier commented on May 3, 2024

@faceleg The updatedAt column mentioned in the PR still exists, but I've never seen any of the other features mentioned.

However, this should actually be pretty easy to do as a plugin

  • Add an afterDefine hook, which defines a _history model whenenver a model is defined.
  • In the same hook, add an afterCreate / afterUpdate hook to the model, which will insert a new row in the history table, each time a row is updated
  • Perhaps also an afterDelete hook?

One problem might be bulk destroy / update. You could fix this by forcing individualHooks to true with a beforeBulkUpdate/Destroy hook

from sequelize.

faceleg avatar faceleg commented on May 3, 2024

Thanks @janmeier, I thought about doing that. Although I'd love to create a plugin like this I don't have time at the moment.

I'm going to investigate using this for the time being: https://github.com/2ndQuadrant/audit-trigger

from sequelize.

faceleg avatar faceleg commented on May 3, 2024

@janmeier would it be appropriate to open an issue "Creation of a revision tracking plugin", that listed requirements and suggested implementation as you have described?

Anyone looking to get their feet wet in some excellent OSS projects might see this and decide to implemented it.

Dreams are free

from sequelize.

janmeier avatar janmeier commented on May 3, 2024

@faceleg Sure, fine by me :)

from sequelize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.