From 4f10bccf844c357245aed2c416e028504b4c84c3 Mon Sep 17 00:00:00 2001 From: takezoe Date: Fri, 1 Nov 2013 03:38:33 +0900 Subject: [PATCH] (refs #114)Add logical remove flag to ACCOUNT. --- src/main/resources/update/1_8.sql | 1 + src/main/scala/model/Account.scala | 6 ++++-- src/main/scala/servlet/AutoUpdateListener.scala | 8 +++----- 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/update/1_8.sql diff --git a/src/main/resources/update/1_8.sql b/src/main/resources/update/1_8.sql new file mode 100644 index 000000000..8b50ddf5a --- /dev/null +++ b/src/main/resources/update/1_8.sql @@ -0,0 +1 @@ +ALTER TABLE ACCOUNT ADD COLUMN REMOVED BOOLEAN DEFAULT FALSE; \ No newline at end of file diff --git a/src/main/scala/model/Account.scala b/src/main/scala/model/Account.scala index 4324d0f51..8c3ff2706 100644 --- a/src/main/scala/model/Account.scala +++ b/src/main/scala/model/Account.scala @@ -14,7 +14,8 @@ object Accounts extends Table[Account]("ACCOUNT") { def lastLoginDate = column[java.util.Date]("LAST_LOGIN_DATE") def image = column[String]("IMAGE") def groupAccount = column[Boolean]("GROUP_ACCOUNT") - def * = userName ~ fullName ~ mailAddress ~ password ~ isAdmin ~ url.? ~ registeredDate ~ updatedDate ~ lastLoginDate.? ~ image.? ~ groupAccount <> (Account, Account.unapply _) + def removed = column[Boolean]("REMOVED") + def * = userName ~ fullName ~ mailAddress ~ password ~ isAdmin ~ url.? ~ registeredDate ~ updatedDate ~ lastLoginDate.? ~ image.? ~ groupAccount ~ removed <> (Account, Account.unapply _) } case class Account( @@ -28,5 +29,6 @@ case class Account( updatedDate: java.util.Date, lastLoginDate: Option[java.util.Date], image: Option[String], - isGroupAccount: Boolean + isGroupAccount: Boolean, + isRemoved: Boolean ) diff --git a/src/main/scala/servlet/AutoUpdateListener.scala b/src/main/scala/servlet/AutoUpdateListener.scala index 1f780188e..5ebc4cb64 100644 --- a/src/main/scala/servlet/AutoUpdateListener.scala +++ b/src/main/scala/servlet/AutoUpdateListener.scala @@ -50,6 +50,7 @@ object AutoUpdate { * The history of versions. A head of this sequence is the current BitBucket version. */ val versions = Seq( + Version(1, 8), Version(1, 7), Version(1, 6), Version(1, 5), @@ -101,11 +102,8 @@ object AutoUpdate { } case _ => Version(0, 0) } - } else { - Version(0, 0) - } - - } + } else Version(0, 0) + } }