yesodweb / persistent

Persistence interface for Haskell allowing multiple storage methods.
MIT License
467 stars 297 forks source link

Allow customizing the unique key SQL names #1422

Open parsonsmatt opened 2 years ago

parsonsmatt commented 2 years ago

Currently, PersistSettings only allows you to modify the name generation for foreign keys. It'd be good if we could generally customize the unique key names too.

lf- commented 2 years ago

it's slightly worse than this: both cases use the same function.

https://github.com/yesodweb/persistent/blob/c3f057757c8406026b2134b0db3d1ec4a668c874/persistent/Database/Persist/Quasi/Internal.hs#L1216-L1217