Skip to content

Commit

Permalink
fix quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoosten committed May 7, 2023
1 parent 5c5e413 commit 49618ca
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/Ampersand/FSpec/ToFSpec/ADL2Plug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Ampersand.Classes
import Ampersand.FSpec.FSpec
import Ampersand.FSpec.ToFSpec.Populated (sortSpecific2Generic)
import Ampersand.Misc.HasClasses
import RIO.Char (toUpper)
import qualified RIO.NonEmpty as NE
import qualified RIO.Set as Set
import qualified RIO.Text as T
Expand Down Expand Up @@ -83,18 +82,10 @@ makeGeneratedSqlPlugs env context = conceptTables <> linkTables
else toSqlColName i
toSqlColName :: Integer -> SqlColumName
toSqlColName i =
text1ToSqlColumName . toText1Unsafe . T.pack $
firstpart (nameSpaceOf nm)
<> lastpart (plainNameOf1 nm)
<> (if i > 0 then show i else mempty)
where
firstpart =
concatMap
( \ns -> case show ns of
"" -> fatal "inpossible to have an empty nameSpace."
h : _ -> toUpper h : "__"
)
lastpart = show
text1ToSqlColumName . toText1Unsafe $
(T.intercalate "_" . map tshow . nameSpaceOf $ nm)
<> plainNameOf nm
<> (if i > 0 then tshow i else mempty)
tableKey = tyroot typ
conceptLookuptable :: [(A_Concept, SqlAttribute)]
conceptLookuptable = [(cpt, cptAttrib cpt) | cpt <- cpts]
Expand Down

0 comments on commit 49618ca

Please sign in to comment.