🚧 WIP 🚧
This commit is contained in:
parent
12d7fafb7d
commit
32bc497c9f
2 changed files with 6 additions and 3 deletions
|
@ -52,7 +52,7 @@ where
|
||||||
|
|
||||||
import Protolude
|
import Protolude
|
||||||
|
|
||||||
import Aggreact.Users (User, UserId (..), BUserId)
|
import Aggreact.Users (User, UserId (..), BUserT, BUserId)
|
||||||
|
|
||||||
import qualified Control.Exception as Ex
|
import qualified Control.Exception as Ex
|
||||||
import Data.Aeson (FromJSON (..), ToJSON (..),
|
import Data.Aeson (FromJSON (..), ToJSON (..),
|
||||||
|
@ -144,7 +144,7 @@ bCommentToComment bc =
|
||||||
{ parent = _parent bc
|
{ parent = _parent bc
|
||||||
, slug = _slug bc
|
, slug = _slug bc
|
||||||
, content = _content bc
|
, content = _content bc
|
||||||
, userid = MUserId (_userid bc)
|
, userid = _userid bc
|
||||||
})
|
})
|
||||||
(DefaultMetas
|
(DefaultMetas
|
||||||
{ updated = _updated bc
|
{ updated = _updated bc
|
||||||
|
@ -155,10 +155,10 @@ data BCommentT f =
|
||||||
{ _parent :: Beam.Columnar f ParentId -- ^ UUID
|
{ _parent :: Beam.Columnar f ParentId -- ^ UUID
|
||||||
, _slug :: Beam.Columnar f Slug -- ^ Text (URL)
|
, _slug :: Beam.Columnar f Slug -- ^ Text (URL)
|
||||||
, _content :: Beam.Columnar f Content -- ^ Text
|
, _content :: Beam.Columnar f Content -- ^ Text
|
||||||
, _userid :: Beam.Columnar (Beam.Nullable f) BUserId -- ^ UUID
|
|
||||||
, _created :: Beam.Columnar f UTCTime
|
, _created :: Beam.Columnar f UTCTime
|
||||||
, _updated :: Beam.Columnar f (Maybe UTCTime)
|
, _updated :: Beam.Columnar f (Maybe UTCTime)
|
||||||
, _id :: Beam.Columnar f Id
|
, _id :: Beam.Columnar f Id
|
||||||
|
, _userid :: Beam.PrimaryKey BUserT (Beam.Nullable f) -- ^ UUID
|
||||||
} deriving (Generic)
|
} deriving (Generic)
|
||||||
type BComment = BCommentT Identity
|
type BComment = BCommentT Identity
|
||||||
type BCommentId = Beam.PrimaryKey BCommentT Identity
|
type BCommentId = Beam.PrimaryKey BCommentT Identity
|
||||||
|
|
|
@ -92,10 +92,13 @@ data BUserT f =
|
||||||
} deriving (Generic)
|
} deriving (Generic)
|
||||||
type BUser = BUserT Identity
|
type BUser = BUserT Identity
|
||||||
type BUserId = Beam.PrimaryKey BUserT Identity
|
type BUserId = Beam.PrimaryKey BUserT Identity
|
||||||
|
type BMUserId = Beam.PrimaryKey BUserT (Beam.Nullable Identity)
|
||||||
deriving instance Show BUser
|
deriving instance Show BUser
|
||||||
deriving instance Eq BUser
|
deriving instance Eq BUser
|
||||||
deriving instance Show BUserId
|
deriving instance Show BUserId
|
||||||
deriving instance Eq BUserId
|
deriving instance Eq BUserId
|
||||||
|
deriving instance Show BMUserId
|
||||||
|
deriving instance Eq BMUserId
|
||||||
instance Beam.Beamable BUserT
|
instance Beam.Beamable BUserT
|
||||||
instance Beam.Table BUserT where
|
instance Beam.Table BUserT where
|
||||||
data PrimaryKey BUserT f =
|
data PrimaryKey BUserT f =
|
||||||
|
|
Loading…
Reference in a new issue