-
Notifications
You must be signed in to change notification settings - Fork 12
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 updated_at field to task #590
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is another function in the DAO that modifies the tasks data, PostgreSQLTaskDAO::update()
, but I'm not sure when/if we use it. We should either:
- Set the
updated_at
field in that function too. - Verify whether it's actually unused and delete it!
I've been reviewing the usage of every DAO function while working on #513 to prevent rewriting unused code, so you may do only 1 this time and we leave 2 for later if you are in a hurry.
2f7834d
to
36f9690
Compare
* IMPORTANT: they must be ordered for their proper execution. | ||
*/ | ||
$sqlFiles = array(); | ||
$sqlFiles[] = SQLPATH . "add-updated-at-to-task.sql"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this before: I think we should also include bump-db-version-2-22.sql
here. I wasn't planning to do any new "stable" releases so every change in the DB should bump its version so we can easily track where the DB is with regard to the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related: #511.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's all good, could you do just this small modification?
I couldn't find anywhere this method was being used so I removed it. I'm trying to port the task DAO to use PDO, but it's been a bit tricky 😬 |
You may want to try to migrate a small DAO first to "practice", we still have some! |
It will be used mainly to track when users update their vacation plans
Whenever a task is created or updated, save the current moment in the updated_at column.
4dd316e
to
fa1d090
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
We need to know when users update their tasks, specially the ones related to their vacation plans.
This patch adds a column called
updated_at
to the task table as well as their migration scripts.It also starts populating the field whenever a task is created or updated.