Persistent: SQL index and constraints? - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Matthias Putz

Is it possible in persistent library to create indexes or constraints for SQL (specifically PostgreSQL)?
Somehow I cant find anything on how to achieve this in the docs, so maybe it is only possible by using raw SQL. If so, what is the way to do it? I woudl assume that the creation and dropping of indexes must be part of the migration :thinking: .

Georgi Lyubenov // googleson78

Seems like it's not supported natively - https://github.com/yesodweb/persistent/issues/919

A client of mine has a bunch of constraints on the table that are simply 'key' (mysql). I wouldn't know how to model that in a migration, I believe they're just search indexes: http...
Matthias Putz

Thanks @Georgi Lyubenov // googleson78 for pointing me there, should have searched there first :/ . Will see if I can write my createSearchIndex :) .

Georgi Lyubenov // googleson78

do share if you succeed, I need to do the same thing at some point in the near future :)