- Create a new project called managing-migrations with the simple stack template:
stack new managing-migrations simple
- Add dependencies on the persistent, persistent-template, persistent-sqlite, text, and mtl libraries in the build-depends sub-section of the executable section:
executable manage-migrations hs-source-dirs: src main-is: Main.hs default-language: Haskell2010 build-depends: base >= 4.7 && < 5 , persistent , persistent-template , persistent-sqlite , text , mtl
-
Open src/Main.hs. We will be adding our source here.
- Add the extensions required for invoking Persistent and persistent-template functions:
{-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ...