SwiftPackageIndex / SwiftPackageIndex-Server

The Swift Package Index is the place to find Swift packages!
https://swiftpackageindex.com
Apache License 2.0
554 stars 45 forks source link

Consider adding a `packages_aggregates` table #3299

Open finestructure opened 2 months ago

finestructure commented 2 months ago

We're technically updating the package record but what we're really doing is aggregating up build data. So it's not the package per se that's changing.

A cleaner solution would perhaps be to move this aggregate field platform_compatibility to a separate table since we're using packages as a convenient place to stick it.

Maybe packages_aggregates. It could hold platform_compatibility and score_details. I'll add an issue to track.

_Originally posted by @finestructure in https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/pull/3298#discussion_r1719584311_

daveverwer commented 2 months ago

As an alternative we could add last_analyzed_at and last_ingested_at fields to make these dates explicit. One of the things I'd like to add to the portal (once it exists) is to surface these two dates to package authors and it feels better to have them be explicit rather than relying on updated_at.