mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
Update flag columns to BOOLEAN.
This commit is contained in:
@@ -6,12 +6,12 @@ object Accounts extends Table[Account]("ACCOUNT") {
|
||||
def userName = column[String]("USER_NAME", O PrimaryKey)
|
||||
def mailAddress = column[String]("MAIL_ADDRESS")
|
||||
def password = column[String]("PASSWORD")
|
||||
def userType = column[Int]("USER_TYPE")
|
||||
def isAdmin = column[Boolean]("ADMINISTRATOR")
|
||||
def url = column[String]("URL")
|
||||
def registeredDate = column[java.sql.Date]("REGISTERED_DATE") // TODO convert java.util.Date later
|
||||
def updatedDate = column[java.sql.Date]("UPDATED_DATE")
|
||||
def lastLoginDate = column[java.sql.Date]("LAST_LOGIN_DATE")
|
||||
def * = userName ~ mailAddress ~ password ~ userType ~ url.? ~ registeredDate ~ updatedDate ~ lastLoginDate.? <> (Account, Account.unapply _)
|
||||
def * = userName ~ mailAddress ~ password ~ isAdmin ~ url.? ~ registeredDate ~ updatedDate ~ lastLoginDate.? <> (Account, Account.unapply _)
|
||||
// def ins = userName ~ mailAddress ~ password ~ userType ~ url.? ~ registeredDate ~ updatedDate ~ lastLoginDate.? <> ({ t => Account(None, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8)}, { (o: Account) => Some((o.userName, o.mailAddress, o.password, o.userType, o.url, o.registeredDate, o.updatedDate, o.lastLoginDate))})
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ case class Account(
|
||||
userName: String,
|
||||
mailAddress: String,
|
||||
password: String,
|
||||
userType: Int,
|
||||
isAdmin: Boolean,
|
||||
url: Option[String],
|
||||
registeredDate: java.sql.Date,
|
||||
updatedDate: java.sql.Date,
|
||||
@@ -29,8 +29,7 @@ case class Account(
|
||||
class AccountDao {
|
||||
import Database.threadLocalSession
|
||||
|
||||
// def insert(o: Account): Account = Accounts.ins returning Accounts.* insert o
|
||||
def insert(o: Account): Long = Accounts.* insert o
|
||||
def insert(o: Account): Long = Accounts insert o
|
||||
|
||||
def select(key: String): Option[Account] = Query(Accounts) filter(_.userName is key.bind) firstOption
|
||||
|
||||
|
||||
Reference in New Issue
Block a user