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
12 {-# OPTIONS_GHC -fno-warn-orphans #-}
14 {-# LANGUAGE Arrows #-}
15 {-# LANGUAGE FunctionalDependencies #-}
16 {-# LANGUAGE TemplateHaskell #-}
18 module Gargantext.Database.Schema.NodeNodeNgrams
22 import Gargantext.Database.Schema.Prelude
23 import Gargantext.Database.Schema.Ngrams (NgramsTypeId, NgramsId)
24 import Gargantext.Database.Admin.Types.Node
26 data NodeNodeNgramsPoly n1 n2 ngrams_id ngt w
27 = NodeNodeNgrams { _nnng_node1_id :: !n1
28 , _nnng_node2_id :: !n2
29 , _nnng_ngrams_id :: !ngrams_id
30 , _nnng_ngramsType :: !ngt
34 type NodeNodeNgramsWrite =
35 NodeNodeNgramsPoly (Column SqlInt4 )
41 type NodeNodeNgramsRead =
42 NodeNodeNgramsPoly (Column SqlInt4 )
49 NodeNodeNgramsPoly CorpusId DocId NgramsId NgramsTypeId Double
51 $(makeAdaptorAndInstance "pNodeNodeNgrams" ''NodeNodeNgramsPoly)
52 makeLenses ''NodeNodeNgramsPoly
55 nodeNodeNgramsTable :: Table NodeNodeNgramsWrite NodeNodeNgramsRead
56 nodeNodeNgramsTable = Table "node_node_ngrams"
57 ( pNodeNodeNgrams NodeNodeNgrams
58 { _nnng_node1_id = requiredTableField "node1_id"
59 , _nnng_node2_id = requiredTableField "node2_id"
60 , _nnng_ngrams_id = requiredTableField "ngrams_id"
61 , _nnng_ngramsType = requiredTableField "ngrams_type"
62 , _nnng_weight = requiredTableField "weight"