mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Add language to schema, extend fts-client
This commit is contained in:
@ -6,7 +6,7 @@ import cats.effect.Sync
|
||||
import cats.data.OptionT
|
||||
import doobie._
|
||||
import doobie.implicits._
|
||||
import docspell.common.{Ident, MetaProposalList}
|
||||
import docspell.common._
|
||||
import docspell.store.Store
|
||||
import docspell.store.impl.Implicits._
|
||||
import docspell.store.records._
|
||||
@ -143,6 +143,7 @@ object QAttachment {
|
||||
id: Ident,
|
||||
item: Ident,
|
||||
collective: Ident,
|
||||
lang: Language,
|
||||
name: Option[String],
|
||||
content: Option[String]
|
||||
)
|
||||
@ -154,11 +155,14 @@ object QAttachment {
|
||||
val mContent = RAttachmentMeta.Columns.content.prefix("m")
|
||||
val iId = RItem.Columns.id.prefix("i")
|
||||
val iColl = RItem.Columns.cid.prefix("i")
|
||||
val cId = RCollective.Columns.id.prefix("c")
|
||||
val cLang = RCollective.Columns.language.prefix("c")
|
||||
|
||||
val cols = Seq(aId, aItem, iColl, aName, mContent)
|
||||
val cols = Seq(aId, aItem, iColl, cLang, aName, mContent)
|
||||
val from = RAttachment.table ++ fr"a INNER JOIN" ++
|
||||
RAttachmentMeta.table ++ fr"m ON" ++ aId.is(mId) ++
|
||||
fr"INNER JOIN" ++ RItem.table ++ fr"i ON" ++ iId.is(aItem)
|
||||
fr"INNER JOIN" ++ RItem.table ++ fr"i ON" ++ iId.is(aItem) ++
|
||||
fr"INNER JOIN" ++ RCollective.table ++ fr"c ON" ++ cId.is(iColl)
|
||||
|
||||
selectSimple(cols, from, Fragment.empty)
|
||||
.query[ContentAndName]
|
||||
|
Reference in New Issue
Block a user