Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
74911135
Commit
74911135
authored
Jul 22, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[nodeStory] migration script gets repo filepath from env
parent
e892077f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
Settings.hs
src/Gargantext/API/Admin/Settings.hs
+1
-1
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+6
-4
No files found.
src/Gargantext/API/Admin/Settings.hs
View file @
74911135
{-|
{-|
Module : Gargantext.API.Admin.Settings
Module : Gargantext.API.Admin.Settings
Description : Settings of the API (Server and Client)
Description : Settings of the API (Server and Client)
Copyright : (c) CNRS, 2017-Present
Copyright : (c) CNRS, 2017-Present
...
...
src/Gargantext/API/Ngrams/Tools.hs
View file @
74911135
...
@@ -23,9 +23,10 @@ import Data.Set (Set)
...
@@ -23,9 +23,10 @@ import Data.Set (Set)
import
Data.Validity
import
Data.Validity
import
Gargantext.API.Ngrams.Types
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
NodeType
(
..
),
ListId
)
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
NodeType
(
..
),
ListId
)
import
Gargantext.Database.Prelude
(
CmdM
,
HasConnectionPool
(
..
))
import
Gargantext.Database.Prelude
(
CmdM
,
HasConnectionPool
(
..
)
,
hasConfig
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
(
gc_repofilepath
)
import
qualified
Data.HashMap.Strict
as
HM
import
qualified
Data.HashMap.Strict
as
HM
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.Set
as
Set
import
qualified
Data.Set
as
Set
...
@@ -199,12 +200,13 @@ getCoocByNgrams' f (Diagonal diag) m =
...
@@ -199,12 +200,13 @@ getCoocByNgrams' f (Diagonal diag) m =
migrateFromDirToDb
::
(
CmdM
env
err
m
,
HasNodeStory
env
err
m
)
migrateFromDirToDb
::
(
CmdM
env
err
m
,
HasNodeStory
env
err
m
)
=>
NSF
.
NodeStoryDir
->
m
()
=>
m
()
migrateFromDirToDb
dir
=
do
migrateFromDirToDb
=
do
pool
<-
view
connPool
pool
<-
view
connPool
listIds
<-
liftBase
$
getNodesIdWithType
pool
NodeList
listIds
<-
liftBase
$
getNodesIdWithType
pool
NodeList
printDebug
"[migrateFromDirToDb] listIds"
listIds
printDebug
"[migrateFromDirToDb] listIds"
listIds
(
NodeStory
nls
)
<-
NSF
.
getRepoNoEnv
dir
listIds
repoFP
<-
view
$
hasConfig
.
gc_repofilepath
(
NodeStory
nls
)
<-
NSF
.
getRepoNoEnv
repoFP
listIds
printDebug
"[migrateFromDirToDb] nls"
nls
printDebug
"[migrateFromDirToDb] nls"
nls
_
<-
mapM
(
\
(
nId
,
a
)
->
do
_
<-
mapM
(
\
(
nId
,
a
)
->
do
n
<-
liftBase
$
nodeExists
pool
nId
n
<-
liftBase
$
nodeExists
pool
nId
...
...
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