From 089ce59f20203bcffc5bda2d4663f029be9abc5f Mon Sep 17 00:00:00 2001 From: Abhinav Sarkar Date: Thu, 7 Jan 2016 02:39:46 +0530 Subject: [PATCH] Changes in dimension table column indexes generation. - Indexes for dimension table columns are generated only if there are more than one non-PK columns. --- src/Ringo/Generator/Create.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ringo/Generator/Create.hs b/src/Ringo/Generator/Create.hs index dd7bf9c..adbd9f3 100644 --- a/src/Ringo/Generator/Create.hs +++ b/src/Ringo/Generator/Create.hs @@ -48,7 +48,7 @@ dimensionTableDefnSQL table@Table {..} = do tablePKColName = head [ cName | PrimaryKey cName <- tableConstraints ] nonPKColNames = [ cName | Column cName _ _ <- tableColumns, cName /= tablePKColName ] indexSQLs = [ "CREATE INDEX ON " <> tabName <> " (" <> cName <> ")" - | cName <- nonPKColNames ] + | cName <- nonPKColNames, length nonPKColNames > 1 ] (++ indexSQLs) <$> tableDefnSQL table factTableDefnSQL :: Fact -> Table -> Reader Env [Text]