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

[BUG] Resolve update trigger functions to not trigger on updates of data like downloads #263

Open
confused-Techie opened this issue Jun 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@confused-Techie
Copy link
Member

Using the existing update trigger of:

CREATE TRIGGER trigger_now_on_updated
  BEFORE UPDATE ON packages
  FOR EACH ROW
EXECUTE PROCEDURE now_on_updated_package();

Some preliminary research suggests the following code will allow us to specify via inclusion what columns we want to actually update with, which honestly may make the most sense to utilize since there's only a few that should be actively tracked as end user or package maintainer changes:

CREATE TRIGGER trigger_now_on_updated
  BEFORE UPDATE 
  OF name, data
  ON packages
  FOR EACH ROW
EXECUTE PROCEDURE now_on_updated_package();

Ideally this should be able to have the table update properly, then after the fact the updated timestamp from the latest version can be taken to replace the value in all previous packages, to undo the damage done from this logic being affected by download count previously

@confused-Techie confused-Techie added the bug Something isn't working label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant