diff --git a/src/Aggreact/Comments/Types.hs b/src/Aggreact/Comments/Types.hs index 851f9ef..b3062b6 100644 --- a/src/Aggreact/Comments/Types.hs +++ b/src/Aggreact/Comments/Types.hs @@ -52,7 +52,7 @@ where import Protolude -import Aggreact.Users (User, UserId (..), BUserId) +import Aggreact.Users (User, UserId (..), BUserT, BUserId) import qualified Control.Exception as Ex import Data.Aeson (FromJSON (..), ToJSON (..), @@ -144,7 +144,7 @@ bCommentToComment bc = { parent = _parent bc , slug = _slug bc , content = _content bc - , userid = MUserId (_userid bc) + , userid = _userid bc }) (DefaultMetas { updated = _updated bc @@ -155,10 +155,10 @@ data BCommentT f = { _parent :: Beam.Columnar f ParentId -- ^ UUID , _slug :: Beam.Columnar f Slug -- ^ Text (URL) , _content :: Beam.Columnar f Content -- ^ Text - , _userid :: Beam.Columnar (Beam.Nullable f) BUserId -- ^ UUID , _created :: Beam.Columnar f UTCTime , _updated :: Beam.Columnar f (Maybe UTCTime) , _id :: Beam.Columnar f Id + , _userid :: Beam.PrimaryKey BUserT (Beam.Nullable f) -- ^ UUID } deriving (Generic) type BComment = BCommentT Identity type BCommentId = Beam.PrimaryKey BCommentT Identity diff --git a/src/Aggreact/Users/Types.hs b/src/Aggreact/Users/Types.hs index 5027f84..93ac7b0 100644 --- a/src/Aggreact/Users/Types.hs +++ b/src/Aggreact/Users/Types.hs @@ -92,10 +92,13 @@ data BUserT f = } deriving (Generic) type BUser = BUserT Identity type BUserId = Beam.PrimaryKey BUserT Identity +type BMUserId = Beam.PrimaryKey BUserT (Beam.Nullable Identity) deriving instance Show BUser deriving instance Eq BUser deriving instance Show BUserId deriving instance Eq BUserId +deriving instance Show BMUserId +deriving instance Eq BMUserId instance Beam.Beamable BUserT instance Beam.Table BUserT where data PrimaryKey BUserT f =