Merge pull request #1046 from eikek/minor-cleanups

Minor cleanups
This commit is contained in:
mergify[bot] 2021-08-31 23:07:54 +00:00 committed by GitHub
commit ec6ebb9e96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 27 deletions

View File

@ -16,22 +16,20 @@ sealed trait ContactKind { self: Product =>
object ContactKind { object ContactKind {
val all = List() val all = List()
case object Phone extends ContactKind case object Phone extends ContactKind
case object Mobile extends ContactKind case object Mobile extends ContactKind
case object Fax extends ContactKind case object Fax extends ContactKind
case object Email extends ContactKind case object Email extends ContactKind
case object Docspell extends ContactKind case object Website extends ContactKind
case object Website extends ContactKind
def fromString(s: String): Either[String, ContactKind] = def fromString(s: String): Either[String, ContactKind] =
s.toLowerCase match { s.toLowerCase match {
case "phone" => Right(Phone) case "phone" => Right(Phone)
case "mobile" => Right(Mobile) case "mobile" => Right(Mobile)
case "fax" => Right(Fax) case "fax" => Right(Fax)
case "email" => Right(Email) case "email" => Right(Email)
case "docspell" => Right(Docspell) case "website" => Right(Website)
case "website" => Right(Website) case _ => Left(s"Not a state value: $s")
case _ => Left(s"Not a state value: $s")
} }
def unsafe(str: String): ContactKind = def unsafe(str: String): ContactKind =

View File

@ -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
);

View File

@ -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
);

View File

@ -18,7 +18,6 @@ type ContactType
| Mobile | Mobile
| Fax | Fax
| Email | Email
| Docspell
| Website | Website
@ -37,9 +36,6 @@ fromString str =
"email" -> "email" ->
Just Email Just Email
"docspell" ->
Just Docspell
"website" -> "website" ->
Just Website Just Website
@ -62,9 +58,6 @@ toString ct =
Email -> Email ->
"Email" "Email"
Docspell ->
"Docspell"
Website -> Website ->
"Website" "Website"
@ -76,5 +69,4 @@ all =
, Email , Email
, Website , Website
, Fax , Fax
, Docspell
] ]

View File

@ -28,9 +28,6 @@ gb ct =
Email -> Email ->
"Email" "Email"
Docspell ->
"Docspell"
Website -> Website ->
"Website" "Website"
@ -50,8 +47,5 @@ de ct =
Email -> Email ->
"E-Mail" "E-Mail"
Docspell ->
"Docspell"
Website -> Website ->
"Webseite" "Webseite"