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 FlexibleContexts #-}
16 {-# LANGUAGE FlexibleInstances #-}
17 {-# LANGUAGE FunctionalDependencies #-}
18 {-# LANGUAGE MultiParamTypeClasses #-}
19 {-# LANGUAGE NoImplicitPrelude #-}
20 {-# LANGUAGE RankNTypes #-}
21 {-# LANGUAGE TemplateHaskell #-}
23 module Gargantext.Database.Schema.NodeNodeNgrams
27 import Gargantext.Database.Schema.Prelude
28 import Gargantext.Database.Schema.Ngrams (NgramsTypeId, NgramsId)
29 import Gargantext.Database.Admin.Types.Node
31 data NodeNodeNgramsPoly n1 n2 ngrams_id ngt w
32 = NodeNodeNgrams { _nnng_node1_id :: !n1
33 , _nnng_node2_id :: !n2
34 , _nnng_ngrams_id :: !ngrams_id
35 , _nnng_ngramsType :: !ngt
39 type NodeNodeNgramsWrite =
40 NodeNodeNgramsPoly (Column PGInt4 )
46 type NodeNodeNgramsRead =
47 NodeNodeNgramsPoly (Column PGInt4 )
53 type NodeNodeNgramsReadNull =
54 NodeNodeNgramsPoly (Column (Nullable PGInt4 ))
55 (Column (Nullable PGInt4 ))
56 (Column (Nullable PGInt4 ))
57 (Column (Nullable PGInt4 ))
58 (Column (Nullable PGFloat8))
61 NodeNodeNgramsPoly CorpusId DocId NgramsId NgramsTypeId Double
63 $(makeAdaptorAndInstance "pNodeNodeNgrams" ''NodeNodeNgramsPoly)
64 makeLenses ''NodeNodeNgramsPoly
67 nodeNodeNgramsTable :: Table NodeNodeNgramsWrite NodeNodeNgramsRead
68 nodeNodeNgramsTable = Table "node_node_ngrams"
69 ( pNodeNodeNgrams NodeNodeNgrams
70 { _nnng_node1_id = required "node1_id"
71 , _nnng_node2_id = required "node2_id"
72 , _nnng_ngrams_id = required "ngrams_id"
73 , _nnng_ngramsType = required "ngrams_type"
74 , _nnng_weight = required "weight"