Skip to content

Instantly share code, notes, and snippets.

@Xe

Xe/SQLTypes.hs Secret

Created December 20, 2015 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xe/ffb1394e315f39804cbf to your computer and use it in GitHub Desktop.
Save Xe/ffb1394e315f39804cbf to your computer and use it in GitHub Desktop.
xena@fluttershy (linux) ~/code/db/derpific
➜ stack build [1]
derpific-0.1.0.0: build
Preprocessing executable 'derpific' for derpific-0.1.0.0...
[1 of 2] Compiling Derpific.SQLTypes ( src/Derpific/SQLTypes.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/derpific/derpific-tmp/Derpific/SQLTypes.o )
/home/xena/code/db/derpific/src/Derpific/SQLTypes.hs:18:73:
Not in scope: type constructor or class ‘ContentID’
/home/xena/code/db/derpific/src/Derpific/SQLTypes.hs:18:73:
Not in scope: type constructor or class ‘ContentID’
/home/xena/code/db/derpific/src/Derpific/SQLTypes.hs:18:73:
Not in scope: type constructor or class ‘UserID’
/home/xena/code/db/derpific/src/Derpific/SQLTypes.hs:18:73:
GHC stage restriction:
‘ContentID’ is used in a top-level splice or annotation,
and must be imported, not defined locally
In an expression type signature: Data.Proxy.Proxy ContentID
In the first argument of ‘persistent-2.2.3:Database.Persist.Sql.Class.sqlType’, namely
‘Data.Proxy.Proxy :: Data.Proxy.Proxy ContentID’
In the fourth argument of ‘FieldDef’, namely
‘persistent-2.2.3:Database.Persist.Sql.Class.sqlType
(Data.Proxy.Proxy :: Data.Proxy.Proxy ContentID)’
-- While building package derpific-0.1.0.0 using:
/home/xena/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.4.0-ghc-7.10.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.4.0 build exe:derpific --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Derpific.SQLTypes where
import Data.Text (Text)
import Data.Time (UTCTime)
import Database.Persist
import Database.Persist.TH
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|
User
name Text
createdAt UTCTime
admin Bool
deriving Show
Content json
raw Text
rendered Text
revision Int
current Bool
deriving Show
Chapter json
title String
content ContentID
createdAt UTCTime
deriving Show
Story json
title Text
descriptionID ContentID
authorID UserID
deleted Bool
deriving Show
|]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment