diff --git a/ringo/src/Ringo/Generator/Create.hs b/ringo/src/Ringo/Generator/Create.hs index 0befd74..799f542 100644 --- a/ringo/src/Ringo/Generator/Create.hs +++ b/ringo/src/Ringo/Generator/Create.hs @@ -94,11 +94,12 @@ factTableIndexStatements fact table = do DimTime -> Just [dimTimeColName cName] NoDimId -> Just [cName] TenantId -> Just [cName] - _ -> Nothing + _ -> Nothing dimCols = [ [ factDimFKIdColumnName settingDimPrefix settingDimTableIdColumnName dimFact dimTable tables ] | (dimFact, dimTable) <- allDims ] + tenantCols = [ [cName, dimTimeColName dimTimeCol] | cName <- maybeToList tenantIdCol ] + return [ CreateIndexTSQL ea (nmc "") (name tabName) (map nmc cols) - | cols <- factCols ++ dimCols ++ [ [cName, dimTimeColName dimTimeCol] - | cName <- maybeToList tenantIdCol ] ] + | cols <- factCols ++ dimCols ++ tenantCols ]