Add the attachment-only option to a source

The upload request can now contain a boolean for importing only
attachments when e-mails are uploaded. This option is now also added
to a source url.

Refs: #983
This commit is contained in:
eikek
2021-08-23 14:19:11 +02:00
parent 45f6357f49
commit 993a391c13
9 changed files with 71 additions and 7 deletions

View File

@ -0,0 +1,8 @@
ALTER TABLE "source"
ADD COLUMN "attachments_only" BOOLEAN NULL;
UPDATE "source"
SET "attachments_only" = FALSE;
ALTER TABLE "source"
ALTER COLUMN "attachments_only" SET NOT NULL;

View File

@ -0,0 +1,8 @@
ALTER TABLE `source`
ADD COLUMN (`attachments_only` BOOLEAN);
UPDATE `source`
SET `attachments_only` = false;
ALTER TABLE `source`
MODIFY `attachments_only` BOOLEAN NOT NULL;

View File

@ -0,0 +1,8 @@
ALTER TABLE "source"
ADD COLUMN "attachments_only" BOOLEAN NULL;
UPDATE "source"
SET "attachments_only" = FALSE;
ALTER TABLE "source"
ALTER COLUMN "attachments_only" SET NOT NULL;

View File

@ -26,7 +26,8 @@ case class RSource(
created: Timestamp,
folderId: Option[Ident],
fileFilter: Option[Glob],
language: Option[Language]
language: Option[Language],
attachmentsOnly: Boolean
) {
def fileFilterOrAll: Glob =
@ -49,6 +50,7 @@ object RSource {
val folder = Column[Ident]("folder_id", this)
val fileFilter = Column[Glob]("file_filter", this)
val language = Column[Language]("doc_lang", this)
val attachOnly = Column[Boolean]("attachments_only", this)
val all =
NonEmptyList.of[Column[_]](
@ -62,7 +64,8 @@ object RSource {
created,
folder,
fileFilter,
language
language,
attachOnly
)
}
@ -90,7 +93,8 @@ object RSource {
table.priority.setTo(v.priority),
table.folder.setTo(v.folderId),
table.fileFilter.setTo(v.fileFilter),
table.language.setTo(v.language)
table.language.setTo(v.language),
table.attachOnly.setTo(v.attachmentsOnly)
)
)