Skip to content

Added configurable date column #27

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

Merged
merged 7 commits into from
Mar 26, 2025

Conversation

salhdev
Copy link
Contributor

@salhdev salhdev commented Sep 2, 2024

Change the date field for the time-series, use another field in your Model instead of created_at

@salhdev salhdev marked this pull request as draft September 3, 2024 08:37
@salhdev
Copy link
Contributor Author

salhdev commented Sep 3, 2024

Hi All,

Great package and very useful !
I added the capability to choose a different field instead of the standard created_at field.
While it works well (I just updated the Tests Models and they all pass) I switched the pull request to draft because I'd like to have the field modifiable at the projection level.
The way it is now each Model can only have one date field while I want to achieve flexibility to be able to store statistics on the same model based on different date_fields on the same Model.
For Example :

  • in Model Reservation for Events, I have 3 important date I want statistics on :
  • 1 The reservation date
  • 2 the payment date
  • 3 the actual event's date

Any ideas you can share on how to achieve this ?

@salhdev salhdev marked this pull request as ready for review September 3, 2024 11:29
@salhdev
Copy link
Contributor Author

salhdev commented Sep 3, 2024

Done,
The functionality is now working and by default works as before.
All existing tests are passing, and will need to add test for the new functionality.
Your Comments are mostly welcome.

@salhdev
Copy link
Contributor Author

salhdev commented Sep 5, 2024

The Pull request is now fully operational including Test and Readme file !
I could not run the package with queue job enabled, I found out that the issue was with the SerializesModel Trait and fixed it in this pull request.
Thanks !

@salhdev salhdev closed this Sep 26, 2024
@salhdev salhdev reopened this Sep 26, 2024
@timothepearce
Copy link
Owner

@salhdev Hi Salhdev, sorry for not answering faster, I'll review your PR when I have time next week :)

Keep model serialization.
@timothepearce
Copy link
Owner

Better late than never. Thanks for your contribution!

@timothepearce timothepearce merged commit aef9cd8 into timothepearce:main Mar 26, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants