File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/cubejs-query-orchestrator/orchestrator Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -257,8 +257,12 @@ class PreAggregationLoader {
257
257
await this . driverFactory ( ) ;
258
258
await client . createSchemaIfNotExists ( this . preAggregation . preAggregationsSchema ) ;
259
259
}
260
- // TODO can be array instead of last
261
- const versionEntry = versionEntries . find ( e => e . table_name === this . preAggregation . tableName ) ;
260
+ // ensure we find appropriate structure version before invalidating anything
261
+ const versionEntry = versionEntries . find (
262
+ v => v . table_name === this . preAggregation . tableName && v . structure_version === structureVersion
263
+ ) || versionEntries . find (
264
+ e => e . table_name === this . preAggregation . tableName
265
+ ) ;
262
266
const newVersionEntry = {
263
267
table_name : this . preAggregation . tableName ,
264
268
structure_version : structureVersion ,
You can’t perform that action at this time.
0 commit comments