Skip to content
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

Set asset pricing data column to null on updates from flow grpc #562

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Docker images at tag `latest` for main branch merges [#551](https://github.com/provenance-io/explorer-service/pull/551)
* Refactor account processing implementation to be more efficient [#552](https://github.com/provenance-io/explorer-service/issues/552)
* Update keep alive times for flow api grpc calls [#558](https://github.com/provenance-io/explorer-service/pull/558)
* Updates to asset pricing table will set data column to null [#562](https://github.com/provenance-io/explorer-service/pull/562)

## [v5.11.0](https://github.com/provenance-io/explorer-service/releases/tag/v5.11.0) - 2024-08-27

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ object AssetPricingTable : IdTable<Int>(name = "asset_pricing") {
val pricing = decimal("pricing", 100, 50)
val pricingDenom = varchar("pricing_denom", 256)
val lastUpdated = datetime("last_updated")
val data = jsonb<AssetPricingTable, AssetPricing>("data", OBJECT_MAPPER)
val data = jsonb<AssetPricingTable, AssetPricing>("data", OBJECT_MAPPER).nullable()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just verifying since I don't see a DB migration here, the current column in the db is nullable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is. I just needed a way to set it on the kotlin side to null for updates.

I will be removing this column in the future anyway: #563

It was saving the json that was returned from figure pricing, which didn't have any extra information that wasn't already being saved as a column.

}

class AssetPricingRecord(id: EntityID<Int>) : IntEntity(id) {
Expand All @@ -237,6 +237,7 @@ class AssetPricingRecord(id: EntityID<Int>) : IntEntity(id) {
findUnique(markerDenom, pricingDenom)?.apply {
this.pricing = pricingAmount
this.lastUpdated = timestamp
this.data = null
} ?: AssetPricingTable.insert {
it[this.markerId] = markerId
it[this.markerAddress] = markerAddress ?: ""
Expand Down
Loading