Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
7f48ce14
Commit
7f48ce14
authored
Jan 06, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DB] Schema update.
parent
6138b96b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
schema.sql
devops/postgres/schema.sql
+5
-3
List.hs
src/Gargantext/Database/Flow/List.hs
+2
-2
NodeNgrams.hs
src/Gargantext/Database/Schema/NodeNgrams.hs
+1
-1
No files found.
devops/postgres/schema.sql
View file @
7f48ce14
...
@@ -61,13 +61,15 @@ CREATE TABLE public.node_ngrams (
...
@@ -61,13 +61,15 @@ CREATE TABLE public.node_ngrams (
ALTER
TABLE
public
.
node_ngrams
OWNER
TO
gargantua
;
ALTER
TABLE
public
.
node_ngrams
OWNER
TO
gargantua
;
CREATE
TABLE
public
.
node_node_ngrams_ngrams
(
CREATE
TABLE
public
.
node_node_ngrams_ngrams
(
node_id
integer
NOT
NULL
,
node1_id
integer
NOT
NULL
,
node2_id
integer
NOT
NULL
,
node_ngrams1_id
integer
NOT
NULL
,
node_ngrams1_id
integer
NOT
NULL
,
node_ngrams2_id
integer
NOT
NULL
,
node_ngrams2_id
integer
NOT
NULL
,
FOREIGN
KEY
(
node_id
)
REFERENCES
public
.
nodes
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
node1_id
)
REFERENCES
public
.
nodes
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
node2_id
)
REFERENCES
public
.
nodes
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
node_ngrams1_id
)
REFERENCES
public
.
node_ngrams
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
node_ngrams1_id
)
REFERENCES
public
.
node_ngrams
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
node_ngrams2_id
)
REFERENCES
public
.
node_ngrams
(
id
)
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
node_ngrams2_id
)
REFERENCES
public
.
node_ngrams
(
id
)
ON
DELETE
CASCADE
,
PRIMARY
KEY
(
node_id
,
node_ngrams1_id
,
node_ngrams2_id
)
PRIMARY
KEY
(
node
1_id
,
node2
_id
,
node_ngrams1_id
,
node_ngrams2_id
)
);
);
ALTER
TABLE
public
.
node_node_ngrams_ngrams
OWNER
TO
gargantua
;
ALTER
TABLE
public
.
node_node_ngrams_ngrams
OWNER
TO
gargantua
;
...
...
src/Gargantext/Database/Flow/List.hs
View file @
7f48ce14
...
@@ -77,8 +77,8 @@ flowList :: FlowCmdM env err m
...
@@ -77,8 +77,8 @@ flowList :: FlowCmdM env err m
flowList
lId
ngs
=
do
flowList
lId
ngs
=
do
printDebug
"listId flowList"
lId
printDebug
"listId flowList"
lId
-- TODO save in database
-- TODO save in database
r
<-
listInsertDb
lId
toNodeNgramsW
(
Map
.
toList
ngs
)
_
r
<-
listInsertDb
lId
toNodeNgramsW
(
Map
.
toList
ngs
)
printDebug
"result "
r
--
printDebug "result " r
listInsert
lId
ngs
listInsert
lId
ngs
--trace (show $ List.filter (\n -> _ne_ngrams n == "versatile") $ List.concat $ Map.elems ngs) $ listInsert lId ngs
--trace (show $ List.filter (\n -> _ne_ngrams n == "versatile") $ List.concat $ Map.elems ngs) $ listInsert lId ngs
pure
lId
pure
lId
...
...
src/Gargantext/Database/Schema/NodeNgrams.hs
View file @
7f48ce14
...
@@ -125,7 +125,7 @@ listInsertDb l f ngs = insertNodeNgrams (f l ngs)
...
@@ -125,7 +125,7 @@ listInsertDb l f ngs = insertNodeNgrams (f l ngs)
insertNodeNgrams
::
[
NodeNgramsW
]
->
Cmd
err
[
Returning
]
insertNodeNgrams
::
[
NodeNgramsW
]
->
Cmd
err
[
Returning
]
insertNodeNgrams
nns
=
runPGSQuery
query
(
PGS
.
Only
$
Values
fields
nns'
)
insertNodeNgrams
nns
=
runPGSQuery
query
(
PGS
.
Only
$
Values
fields
nns'
)
where
where
fields
=
map
(
\
t
->
QualifiedIdentifier
Nothing
t
)
[
"int4"
,
"int4"
,
"text"
,
"int4"
fields
=
map
(
\
t
->
QualifiedIdentifier
Nothing
t
)
[
"int4"
,
"int4"
,
"text"
,
"int4"
,
"int4"
,
"int4"
,
"int4"
,
"int4"
,
"int4"
,
"int4"
,
"int4"
,
"int4"
,
"float8"
]
,
"float8"
]
-- nns' :: [(Int, ListTypeId, NgramsText, NgramsTypeId ,NgramsField, NgramsTag, NgramsClass, Double)]
-- nns' :: [(Int, ListTypeId, NgramsText, NgramsTypeId ,NgramsField, NgramsTag, NgramsClass, Double)]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment