From 9dfe7f30a0e2b75d9abef93c570e22f5605a8a91 Mon Sep 17 00:00:00 2001 From: eikek Date: Tue, 31 Aug 2021 21:57:40 +0200 Subject: [PATCH 1/2] Remove unused contact kind --- .../scala/docspell/common/ContactKind.scala | 24 +++++++++---------- .../webapp/src/main/elm/Data/ContactType.elm | 8 ------- .../main/elm/Messages/Data/ContactType.elm | 6 ----- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/modules/common/src/main/scala/docspell/common/ContactKind.scala b/modules/common/src/main/scala/docspell/common/ContactKind.scala index 152ce4aa..4c4ca692 100644 --- a/modules/common/src/main/scala/docspell/common/ContactKind.scala +++ b/modules/common/src/main/scala/docspell/common/ContactKind.scala @@ -16,22 +16,20 @@ sealed trait ContactKind { self: Product => object ContactKind { val all = List() - case object Phone extends ContactKind - case object Mobile extends ContactKind - case object Fax extends ContactKind - case object Email extends ContactKind - case object Docspell extends ContactKind - case object Website extends ContactKind + case object Phone extends ContactKind + case object Mobile extends ContactKind + case object Fax extends ContactKind + case object Email extends ContactKind + case object Website extends ContactKind def fromString(s: String): Either[String, ContactKind] = s.toLowerCase match { - case "phone" => Right(Phone) - case "mobile" => Right(Mobile) - case "fax" => Right(Fax) - case "email" => Right(Email) - case "docspell" => Right(Docspell) - case "website" => Right(Website) - case _ => Left(s"Not a state value: $s") + case "phone" => Right(Phone) + case "mobile" => Right(Mobile) + case "fax" => Right(Fax) + case "email" => Right(Email) + case "website" => Right(Website) + case _ => Left(s"Not a state value: $s") } def unsafe(str: String): ContactKind = diff --git a/modules/webapp/src/main/elm/Data/ContactType.elm b/modules/webapp/src/main/elm/Data/ContactType.elm index cc23f073..52d515ae 100644 --- a/modules/webapp/src/main/elm/Data/ContactType.elm +++ b/modules/webapp/src/main/elm/Data/ContactType.elm @@ -18,7 +18,6 @@ type ContactType | Mobile | Fax | Email - | Docspell | Website @@ -37,9 +36,6 @@ fromString str = "email" -> Just Email - "docspell" -> - Just Docspell - "website" -> Just Website @@ -62,9 +58,6 @@ toString ct = Email -> "Email" - Docspell -> - "Docspell" - Website -> "Website" @@ -76,5 +69,4 @@ all = , Email , Website , Fax - , Docspell ] diff --git a/modules/webapp/src/main/elm/Messages/Data/ContactType.elm b/modules/webapp/src/main/elm/Messages/Data/ContactType.elm index c361f297..af9d0a9d 100644 --- a/modules/webapp/src/main/elm/Messages/Data/ContactType.elm +++ b/modules/webapp/src/main/elm/Messages/Data/ContactType.elm @@ -28,9 +28,6 @@ gb ct = Email -> "Email" - Docspell -> - "Docspell" - Website -> "Website" @@ -50,8 +47,5 @@ de ct = Email -> "E-Mail" - Docspell -> - "Docspell" - Website -> "Webseite" From 3a5ef62715397342d868239fc7a9891f6dae1b16 Mon Sep 17 00:00:00 2001 From: eikek Date: Wed, 1 Sep 2021 00:43:58 +0200 Subject: [PATCH 2/2] Add missing sql changesets --- .../src/main/resources/db/migration/h2/V1.26.1__totp.sql | 7 +++++++ .../main/resources/db/migration/mariadb/V1.26.1__totp.sql | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 modules/store/src/main/resources/db/migration/h2/V1.26.1__totp.sql create mode 100644 modules/store/src/main/resources/db/migration/mariadb/V1.26.1__totp.sql diff --git a/modules/store/src/main/resources/db/migration/h2/V1.26.1__totp.sql b/modules/store/src/main/resources/db/migration/h2/V1.26.1__totp.sql new file mode 100644 index 00000000..bcbe53cc --- /dev/null +++ b/modules/store/src/main/resources/db/migration/h2/V1.26.1__totp.sql @@ -0,0 +1,7 @@ +CREATE TABLE "totp" ( + "user_id" varchar(254) not null primary key, + "enabled" boolean not null, + "secret" varchar(254) not null, + "created" timestamp not null, + FOREIGN KEY ("user_id") REFERENCES "user_"("uid") ON DELETE CASCADE +); diff --git a/modules/store/src/main/resources/db/migration/mariadb/V1.26.1__totp.sql b/modules/store/src/main/resources/db/migration/mariadb/V1.26.1__totp.sql new file mode 100644 index 00000000..94266746 --- /dev/null +++ b/modules/store/src/main/resources/db/migration/mariadb/V1.26.1__totp.sql @@ -0,0 +1,7 @@ +CREATE TABLE `totp` ( + `user_id` varchar(254) not null primary key, + `enabled` boolean not null, + `secret` varchar(254) not null, + `created` timestamp not null, + FOREIGN KEY (`user_id`) REFERENCES `user_`(`uid`) ON DELETE CASCADE +);