When I try to compile the code example from the Migrations section of the Persistent page, after fixing a small issue that the compiler explains how to fix¹, I still get an error like:
Variable not in scope: entityDefs :: [EntityDef]
Suggested fix:
Perhaps use one of these:
‘entityDef’ (imported from Database.Persist.Sqlite),
‘entityKey’ (imported from Database.Persist.Sqlite)
|
39 | runMigration $ migrate entityDefs $ entityDef (Nothing :: Maybe Person)
| ^^^^^^^^^^
Seems to me like it's because there is a missing mkEntityDefList "entityDefs" in the persist block.
¹ Namely, that language extensions StandaloneDeriving and FlexibleInstances are required, but let's make that a separate issue because I think it affects most of the examples, not just the Migrations one.
When I try to compile the code example from the Migrations section of the Persistent page, after fixing a small issue that the compiler explains how to fix¹, I still get an error like:
Seems to me like it's because there is a missing
mkEntityDefList "entityDefs"
in the persist block.¹ Namely, that language extensions
StandaloneDeriving
andFlexibleInstances
are required, but let's make that a separate issue because I think it affects most of the examples, not just the Migrations one.