Commits

Semyon Novikov committed 8230325

Hardcoded some rules for my current work

  • Participants
  • Parent commits b85968e

Comments (0)

Files changed (2)

File src/GimmeModels/Schema/SQLSchema/Parser.hs

     where 
         cleanSchema s = Schema $ cleanTables s
         cleanTables s = map cleanTable (schemaTables s)
-        cleanTable t  = t { tableFields = filter (\f -> lower (fieldType f) /= lower "key") (tableFields t) } 
+        cleanTable t  = t { tableFields = filter isUseful (tableFields t) } 
         lower         = map toLower
-
+        isUseful f    = lower (fieldType f) /= "key" && lower (fieldName f) /= "constraint"

File src/GimmeModels/Schema/SQLSchema/Types.hs

         str                          = [toLower c | c <- s]
         splitS s'                    = [unpack  s | s <- split '_' $ pack s']
         capitalizeFirst Prop "" s    = s
+        capitalizeFirst _ acc (c:[]) = [toUpper c]
         capitalizeFirst _ acc (c:cs) = acc ++ (toUpper c : cs)
+        capitalizeFirst _ acc [] = "" 
 
 parseSchemaFromString = parseSchema