From 9fe98166238ef4813383258c0789bfa2079f7ec0 Mon Sep 17 00:00:00 2001 From: Abhinav Sarkar Date: Wed, 6 Jul 2016 23:17:12 +0530 Subject: [PATCH] Refactors to simplify code. --- ringo/src/Ringo/Generator/Create.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 ]