indexer
indexer copied to clipboard
feat: add history for cost models and set view table for latest models
Reason for this PR.
tl;dr: needed for TAP cost model checks
We currently have an issue where when a cost model just got updated the indexer-service takes some time to update but in the meantime it errors out due to the model not matching, so we need to have a history in the db so that we can accept both, the new and the old one for a delimited amount of time (eg. ~2min) This PR includes a breaking change:
- CostModels table no longer exists
- cost_models table is created, this will contain a history of all past cost models
- CostModels table will keep working as a view from cost_models this way other programs that read into CostModels will keep working as they are, this view will contain only the latest model of each deployment thus not breaking anything else