]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Schema/NodeNodeNgrams2.hs
[FIX] Phylo
[gargantext.git] / src / Gargantext / Database / Schema / NodeNodeNgrams2.hs
1 {-|
2 Module : Gargantext.Database.Schema.NodeNodeNgrams
3 Description : TODO: remove this module and table in database
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 TemplateHaskell #-}
17
18 module Gargantext.Database.Schema.NodeNodeNgrams2
19 where
20
21 import Gargantext.Database.Schema.Prelude
22 import Gargantext.Database.Schema.NodeNgrams (NodeNgramsId)
23 import Gargantext.Database.Admin.Types.Node
24 import Prelude
25
26 data NodeNodeNgrams2Poly node_id nodengrams_id w
27 = NodeNodeNgrams2 { _nnng2_node_id :: !node_id
28 , _nnng2_nodengrams_id :: !nodengrams_id
29 , _nnng2_weight :: !w
30 } deriving (Show)
31
32 type NodeNodeNgrams2Write =
33 NodeNodeNgrams2Poly (Column SqlInt4 )
34 (Column SqlInt4 )
35 (Column SqlFloat8)
36
37 type NodeNodeNgrams2Read =
38 NodeNodeNgrams2Poly (Column SqlInt4 )
39 (Column SqlInt4 )
40 (Column SqlFloat8)
41
42 type NodeNodeNgrams2 =
43 NodeNodeNgrams2Poly DocId NodeNgramsId Double
44
45 $(makeAdaptorAndInstance "pNodeNodeNgrams2" ''NodeNodeNgrams2Poly)
46 makeLenses ''NodeNodeNgrams2Poly
47
48 nodeNodeNgrams2Table :: Table NodeNodeNgrams2Write NodeNodeNgrams2Read
49 nodeNodeNgrams2Table = Table "node_node_ngrams2"
50 ( pNodeNodeNgrams2 NodeNodeNgrams2
51 { _nnng2_node_id = requiredTableField "node_id"
52 , _nnng2_nodengrams_id = requiredTableField "nodengrams_id"
53 , _nnng2_weight = requiredTableField "weight"
54 }
55 )