Giter Site home page Giter Site logo

audit_star's People

Contributors

jerrysievers avatar packrat386 avatar slania avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audit_star's Issues

Needs lock safety

Not sure if this should be the responsibility of audit_star itself or your migration framework, but the audit_all method doesn't have anything to prevent long lock contention resulting from waiting for a lock which lock_timeout would prevent.

Snapshot views are not accurate

The *snapshot views created by audit_star are not accurate. In order to show a change history accurately, a recursive query is going to be required. Here is an example of what shows instead of what should be shown in the snapshot view.

Given a record with the following 3 changes, the "customer_id" only gets set to a value on the 3rd change

audit=# SELECT foos_audit_id, changed_at, change FROM service_audit_raw.foos_audit WHERE primary_key = '7068' ORDER BY foos_audit_id;
-[ RECORD 1 ]----------+----------------------------------------------------------------------
foos_audit_id | 2176
changed_at             | 2016-08-14 00:21:13.740758
change                 |
-[ RECORD 2 ]----------+----------------------------------------------------------------------
foos_audit_id | 2177
changed_at             | 2016-08-14 00:21:13.740758
change                 | {"pending": "f", "updated_at": "2016-08-14 00:21:13.807175"}
-[ RECORD 3 ]----------+----------------------------------------------------------------------
foos_audit_id | 2178
changed_at             | 2016-08-14 00:21:13.740758
change                 | {"customer_id": "3215620", "updated_at": "2016-08-14 00:21:13.830382"}

However, here is what the snapshot view actually shows:

audit=# SELECT foos_audit_id, customer_id FROM service_audit.foos_audit_snapshot WHERE primary_key = '7068' ORDER BY foos_audit_id;
-[ RECORD 1 ]----------+--------
foos_audit_id | 2176
customer_id             | 3215620
-[ RECORD 2 ]----------+--------
foos_audit_id | 2177
customer_id             | 3215620
-[ RECORD 3 ]----------+--------
foos_audit_id | 2178
customer_id             | 3215620

It should show NULL for customer_id until the very last record.

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.