Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add last_updated for all tables #1138

Closed
amplifi opened this issue Feb 17, 2017 · 1 comment · Fixed by #1705
Closed

Add last_updated for all tables #1138

amplifi opened this issue Feb 17, 2017 · 1 comment · Fixed by #1705
Assignees

Comments

@amplifi
Copy link
Contributor

amplifi commented Feb 17, 2017

Currently, the platform only records last_updated datestamps for organizations and projects. By adding a last_updated datestamp column to all platform tables, we will be able to:

  • leverage the availability of this data for more efficient indexing
  • offer the capability to search/filter project data by date added
  • add user dashboard features like displaying events since last login
  • provide our partners with a chronological audit of data actions
  • enhance platform security by supporting action-based alerts
  • ...

The last_updated column should be initialized to a default value that is distinct from the range of actual values, such as 01/01/2016 00:00:00, to make it easy to identify rows that have or have not been modified since implementing this change. The last_updated values for each table should be managed via PostgreSQL trigger, which eliminates the need for any platform code changes and results in a more reliable implementation, as the database will be solely responsible for setting and modifying the value (particularly in the case of platform action failure, rollback, transaction queuing, etc).

@amplifi
Copy link
Contributor Author

amplifi commented Apr 3, 2017

Additional requirements for update + username log: https://devwiki.corp.cadasta.org/History%20Log

@oliverroick oliverroick added this to the Sprint 16 milestone Apr 10, 2017
@dpalomino dpalomino removed this from the Sprint 16 milestone Jun 29, 2017
amplifi added a commit that referenced this issue Sep 6, 2017
* Add creation and update fields for audit log

* Resolve migration conflicts and fix tests

* Update migration dependencies after rebase

* Update migration test for compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants