diff --git a/src/Database/PostgreSQL/PQTypes/Checks.hs b/src/Database/PostgreSQL/PQTypes/Checks.hs index d549dae..27f11d1 100644 --- a/src/Database/PostgreSQL/PQTypes/Checks.hs +++ b/src/Database/PostgreSQL/PQTypes/Checks.hs @@ -42,7 +42,6 @@ import Database.PostgreSQL.PQTypes.Migrate import Database.PostgreSQL.PQTypes.Model import Database.PostgreSQL.PQTypes.SQL.Builder import Database.PostgreSQL.PQTypes.Versions -import Database.PostgreSQL.PQTypes.Utils.NubList headExc :: String -> [a] -> a headExc s [] = error s @@ -427,7 +426,7 @@ checkDBStructure options tables = fmap mconcat . forM tables $ \(table, version) runQuery_ $ sqlGetForeignKeys table fkeys <- fetchMany fetchForeignKey triggers <- getDBTriggers tblName - checkedOverlaps <- checkOverlappingIndexes + checkedOverlaps <- checkOverlappingIndexes return $ mconcat [ checkColumns 1 tblColumns desc , checkPrimaryKey tblPrimaryKey pk @@ -573,7 +572,7 @@ checkDBStructure options tables = fmap mconcat . forM tables $ \(table, version) allCoverage :: [[RawSQL ()]] allCoverage = maybe [] pkColumns pkey:allIndexes - + -- A foreign key is covered if it is a prefix of a list of indices. -- So a FK on a is covered by an index on (a, b) but not an index on (b, a). coveredFK :: ForeignKey -> [[RawSQL ()]] -> Bool @@ -602,7 +601,7 @@ checkDBStructure options tables = fmap mconcat . forM tables $ \(table, version) if eoCheckOverlappingIndexes options then go else pure mempty - where + where go = do let handleOverlap (contained, contains) = mconcat