]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Schema/NodeNode_NodeNode.hs
[Community] Type Design (WIP)
[gargantext.git] / src / Gargantext / Database / Schema / NodeNode_NodeNode.hs
1 {-|
2 Module : Gargantext.Database.Schema.NodeNode_NodeNode
3 Description :
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 -}
11
12 {-# OPTIONS_GHC -fno-warn-orphans #-}
13
14 {-# LANGUAGE Arrows #-}
15 {-# LANGUAGE FunctionalDependencies #-}
16 {-# LANGUAGE QuasiQuotes #-}
17 {-# LANGUAGE TemplateHaskell #-}
18
19 module Gargantext.Database.Schema.NodeNode where
20
21 import Data.Maybe (Maybe)
22 import Gargantext.Core.Types
23 import Gargantext.Database.Schema.Prelude
24 import Gargantext.Prelude
25
26
27 data NodeNode_NodeNodePoly nn1 nn2 weight
28 = NodeNode_NodeNode { _nnnn_nn1_id :: !nn1
29 , _nnnn_nn2_id :: !nn2
30 , _nnnn_weight :: !weight
31 } deriving (Show)
32
33 type NodeNodeWrite = NodeNodePoly (Column (PGInt4))
34 (Column (PGInt4))
35 (Maybe (Column (PGFloat8)))
36
37 type NodeNodeRead = NodeNodePoly (Column (PGInt4))
38 (Column (PGInt4))
39 (Maybe (Column (PGFloat8)))
40
41 type NodeNodeReadNull = NodeNodePoly (Column (Nullable PGInt4))
42 (Column (Nullable PGInt4))
43 (Column (Nullable PGFloat8))
44
45 type NodeNode_NodeNode = NodeNode_NodeNodePoly Int Int (Maybe Double)
46
47 $(makeAdaptorAndInstance "pNodeNode_NodeNode" ''NodeNode_NodeNodePoly)
48 makeLenses ''NodeNode_NodeNodePoly
49
50 nodeNode_NodeNodeTable :: Table NodeNode_NodeNodeWrite NodeNode_NodeNodeRead
51 nodeNode_NodeNodeTable =
52 Table "nodesnodes_nodesnodes"
53 ( pNodeNode_NodeNode
54 NodeNode_NodeNode { _nnnn_nn1_id = required "nn1_id"
55 , _nnnn_nn2_id = required "nn2_id"
56 , _nnnn_weight = optional "weight"
57 }
58 )