mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05: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
|
||||
|
||||
|
||||
@@ -5,20 +5,20 @@ import scala.slick.driver.H2Driver.simple._
|
||||
object Repositories extends Table[Repository]("REPOSITORY") {
|
||||
def repositoryName= column[String]("REPOSITORY_NAME", O PrimaryKey)
|
||||
def userName = column[String]("USER_NAME", O PrimaryKey)
|
||||
def repositoryType = column[Int]("REPOSITORY_TYPE") // TODO should be sealed?
|
||||
def isPrivate = column[Boolean]("PRIVATE")
|
||||
def description = column[String]("DESCRIPTION")
|
||||
def defaultBranch = column[String]("DEFAULT_BRANCH")
|
||||
def registeredDate = column[java.sql.Date]("REGISTERED_DATE") // TODO convert java.util.Date later
|
||||
def updatedDate = column[java.sql.Date]("UPDATED_DATE")
|
||||
def lastActivityDate = column[java.sql.Date]("LAST_ACTIVITY_DATE")
|
||||
def * = repositoryName ~ userName ~ repositoryType ~ description.? ~ defaultBranch ~ registeredDate ~ updatedDate ~ lastActivityDate <> (Repository, Repository.unapply _)
|
||||
def * = repositoryName ~ userName ~ isPrivate ~ description.? ~ defaultBranch ~ registeredDate ~ updatedDate ~ lastActivityDate <> (Repository, Repository.unapply _)
|
||||
// def ins = repositoryName ~ userName ~ repositoryType ~ description.? ~ defaultBranch ~ registeredDate ~ updatedDate ~ lastActivityDate <> ({ t => Project(None, t._1, t._2, t._3, t._4, t._5, t._6, t._7, t._8)}, { (o: Project) => Some((o.projectName, o.userId, o.projectType, o.description, o.defaultBranch, o.registeredDate, o.updatedDate, o.lastActivityDate))})
|
||||
}
|
||||
|
||||
case class Repository(
|
||||
repositoryName: String,
|
||||
userName: String,
|
||||
repositoryType: Int,
|
||||
isPrivate: Boolean,
|
||||
description: Option[String],
|
||||
defaultBranch: String,
|
||||
registeredDate: java.sql.Date,
|
||||
|
||||
Reference in New Issue
Block a user