@@ -143,15 +143,17 @@ instance PGTypeName a => PGTypeName (Maybe a) where
143143-- Constraint -> DDL fragment
144144-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145145
146−class RenderDefault val where
147− renderDefault :: Proxy val -> String
146+class RenderDefaultValue val typ where
147+ renderDefaultValue :: Proxy val -> Proxy typ -> String
148148
149−instance Reflectable sym String => RenderDefault sym where
150− renderDefault _ = "DEFAULT '" <> reflectType (Proxy :: Proxy sym) <> "'"
151−else instance Reflectable val Int => RenderDefault val where
152− renderDefault _ = "DEFAULT " <> show (reflectType (Proxy :: Proxy val))
153−else instance Reflectable val Boolean => RenderDefault val where
154− renderDefault _ = if reflectType (Proxy :: Proxy val) then "DEFAULT true" else "DEFAULT false"
149+instance Reflectable sym String => RenderDefaultValue sym String where
150+ renderDefaultValue _ _ = "DEFAULT '" <> reflectType (Proxy :: Proxy sym) <> "'"
151+
152+instance Reflectable val Int => RenderDefaultValue val Int where
153+ renderDefaultValue _ _ = "DEFAULT " <> show (reflectType (Proxy :: Proxy val))
154+
155+instance Reflectable val Boolean => RenderDefaultValue val Boolean where
156+ renderDefaultValue _ _ = if reflectType (Proxy :: Proxy val) then "DEFAULT true" else "DEFAULT false"
155157
156158class RenderConstraint a where
157159 renderConstraint :: Proxy a -> String
@@ -165,8 +167,8 @@ else instance RenderConstraint a => RenderConstraint (AutoIncrement a) where
165167else instance RenderConstraint a => RenderConstraint (Unique a) where
166168 renderConstraint _ = joinConstraints "UNIQUE" (renderConstraint (Proxy :: Proxy a))
167169
168−else instance (RenderDefault val, RenderConstraint a) => RenderConstraint (Default val a) where
169− renderConstraint _ = joinConstraints (renderDefault (Proxy :: Proxy val)) (renderConstraint (Proxy :: Proxy a))
170+else instance (RenderDefaultValue val a, RenderConstraint a) => RenderConstraint (Default val a) where
171+ renderConstraint _ = joinConstraints (renderDefaultValue (Proxy :: Proxy val) (Proxy :: Proxy a)) (renderConstraint (Proxy :: Proxy a))
170172
171173else instance (IsSymbol table, IsSymbol col, RenderConstraint a) => RenderConstraint (ForeignKey table References col a) where
172174 renderConstraint _ = joinConstraints