File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/cubejs-server-core/core Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,12 @@ class CompilerApi {
11
11
this . logger = this . options . logger ;
12
12
this . preAggregationsSchema = this . options . preAggregationsSchema ;
13
13
this . allowUngroupedWithoutPrimaryKey = this . options . allowUngroupedWithoutPrimaryKey ;
14
+ this . schemaVersion = this . options . schemaVersion ;
14
15
}
15
16
16
17
async getCompilers ( ) {
17
18
let compilerVersion = (
18
- this . options . schemaVersion && this . options . schemaVersion ( ) ||
19
+ this . schemaVersion && this . schemaVersion ( ) ||
19
20
'default_schema_version'
20
21
) . toString ( ) ;
21
22
if ( this . options . devServer ) {
Original file line number Diff line number Diff line change @@ -287,17 +287,20 @@ class CubejsServerCore {
287
287
getCompilerApi ( context ) {
288
288
const appId = this . contextToAppId ( context ) ;
289
289
let compilerApi = this . compilerCache . get ( appId ) ;
290
+ const currentSchemaVersion = this . options . schemaVersion && ( ( ) => this . options . schemaVersion ( context ) ) ;
290
291
if ( ! compilerApi ) {
291
292
compilerApi = this . createCompilerApi (
292
293
this . repositoryFactory ( context ) , {
293
294
dbType : ( dataSourceContext ) => this . contextToDbType ( { ...context , ...dataSourceContext } ) ,
294
295
externalDbType : this . contextToExternalDbType ( context ) ,
295
- schemaVersion : this . options . schemaVersion && ( ( ) => this . options . schemaVersion ( context ) ) ,
296
+ schemaVersion : currentSchemaVersion ,
296
297
preAggregationsSchema : this . preAggregationsSchema ( context )
297
298
}
298
299
) ;
299
300
this . compilerCache . set ( appId , compilerApi ) ;
300
301
}
302
+
303
+ compilerApi . schemaVersion = currentSchemaVersion ;
301
304
return compilerApi ;
302
305
}
303
306
You can’t perform that action at this time.
0 commit comments