cosmicds / cds-api

API for accessing the CosmicDS database
GNU General Public License v3.0
0 stars 3 forks source link

Add timestamp filtering for Hubble all-data endpoint #74

Closed Carifio24 closed 1 year ago

Carifio24 commented 1 year ago

This PR adds the ability to submit a timestamp (as milliseconds UTC time) for the /hubbles_law/all-data endpoint as a query parameter. If specified, only data from before the timestamp will be returned. This is the first step towards resolving https://github.com/cosmicds/hubbleds/issues/284.

To make this possible, a new column last_data_update was added to both the student and class summary tables. In each case, the value of this timestamp is the latest value of a last_modified timestamp for one of the measurements of that student/class. The SQL table definitions and Sequelize models have been updated accordingly.