Commit a6cc37fb authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FLOW][DB] fix name 255 in db.

parent 401c86e5
......@@ -59,6 +59,7 @@ flowDatabase ff fp cName = do
ids <- runCmd' $ insertDocuments masterUserId corpusId hyperdataDocuments
printDebug "Docs IDs : " (length ids)
idsRepeat <- runCmd' $ insertDocuments masterUserId corpusId hyperdataDocuments
printDebug "Repeated Docs IDs : " (length ids)
-- Ngrams Flow
let documentsWithId = mergeData (toInserted ids) (toInsert hyperdataDocuments)
......@@ -69,7 +70,7 @@ flowDatabase ff fp cName = do
-- List Flow
listId2 <- runCmd' $ listFlow masterUserId corpusId indexedNgrams
printDebug "list id:" listId2
printDebug "list id : " listId2
printDebug "Docs IDs : " (length idsRepeat)
......@@ -110,7 +111,6 @@ subFlow username cName = do
------------------------------------------------------------------------
type HashId = Text
type NodeId = Int
type ListId = Int
......
......@@ -73,7 +73,7 @@ import Database.PostgreSQL.Simple.ToRow (ToRow(..))
import Database.PostgreSQL.Simple.Types (Values(..), QualifiedIdentifier(..))
import Data.Text (Text)
import qualified Data.Text as DT (pack, unpack, concat)
import qualified Data.Text as DT (pack, unpack, concat, take)
import qualified Data.Digest.Pure.SHA as SHA (sha256, showDigest)
import qualified Data.ByteString.Lazy.Char8 as DC (pack)
......@@ -151,7 +151,7 @@ queryInsert = [sql|
prepare :: UserId -> ParentId -> [HyperdataDocument] -> [InputData]
prepare uId pId = map (\h -> InputData tId uId pId
(maybe "No Title of Document" identity $ _hyperdataDocument_title h)
(DT.take 255 <$> maybe "No Title of Document" identity $ _hyperdataDocument_title h)
(toJSON h)
)
where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment