Make it build with persistent

This commit is contained in:
fr33domlover 2016-02-06 13:36:35 +00:00
parent e6fbca1c2a
commit b7aa7ec45d
2 changed files with 49 additions and 0 deletions

45
src/Vervis/Persist.hs Normal file
View file

@ -0,0 +1,45 @@
{- This file is part of Vervis.
-
- Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
-
- Copying is an act of love. Please copy, reuse and share.
-
- The author(s) have dedicated all copyright and related and neighboring
- rights to this software to the public domain worldwide. This software is
- distributed without any warranty.
-
- You should have received a copy of the CC0 Public Domain Dedication along
- with this software. If not, see
- <http://creativecommons.org/publicdomain/zero/1.0/>.
-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Vervis.Persist
--(
--)
where
import Control.Monad.IO.Class (liftIO)
import Database.Persist
import Database.Persist.Sqlite
import Database.Persist.TH
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
Person
name String
age Int Maybe
deriving Show
BlogPost
title String
authorId PersonId
deriving Show
|]

View file

@ -30,6 +30,7 @@ library
, Vervis.Git
, Vervis.Monad
, Vervis.Ops
, Vervis.Persist
, Vervis.Types
-- other-modules:
-- other-extensions:
@ -42,6 +43,9 @@ library
, json-state
, hashable
, hourglass
, persistent
, persistent-sqlite
, persistent-template
, text >=1
, time-units
, transformers >=0.4.2