If I remember correctly (from a presentation about Yesod at InfoQ), adding an index must be done manually, there's no support in Yesod for doing it automatically.
Column sizes can be specified by typing maxlen=<size>
in the field definition. BLOB
s can be stored as a ByteString
s. An example for both fields looks like this:
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
Something
b ByteString
t Text maxlen=30
|]
The BLOB
data type will work with Sqlite3, since I've used it in the past, but I don't know for sure about the maxlen
attribute, I just read about it. You can find more details in the Yesod book, chapter about Persistent.
As for the foreign keys, my experience tells me that those are synonyms. Just don't forget to enable foreign keys, since they're disabled by default.