stac-utils / stac-utils/pgstac
Add versioning for collection item_assets
@bitner is already working on this.
Since Oct 23, 2025.
- Dominant language
- PLpgSQL
- Stars
- 223
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Description
Currently, all items are dehydrated when they are added to the items table using the current value of item_assets for the items collection. This means that any field that is present in the collection item_assets is stripped from the assets in that item. Additionally, if there are any fields that were present in the collection item_assets, a special marker value is added to the item's assets to mark that we should not pull in the value from the collection item_assets.
Functionally, this means that if anything is modified or removed (additions are fine) in the collection's item_assets, when we rehydrate any item from that collection, the assets returned will not reflect those changes and additionally any of the special markers will make their way into the item that is returned (this is an issue both with db native hydration and api hydration).
In order to maintain backwards compatibility with previously written items, we should maintain versioning for collections (or at the least a collection's item_assets) so that we can point an item at the exact version of the collection that was used initially to dehydrate the item.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.