(refs #115)Adding SSH Key form is available

This commit is contained in:
takezoe
2014-03-09 00:57:00 +09:00
parent 0cfe31ccd9
commit f99d37cfad
8 changed files with 165 additions and 66 deletions

View File

@@ -4,9 +4,12 @@ import scala.slick.driver.H2Driver.simple._
object SshKeys extends Table[SshKey]("SSH_KEY") {
def userName = column[String]("USER_NAME")
def sshKeyId = column[Int]("SSH_KEY")
def sshKeyId = column[Int]("SSH_KEY_ID", O AutoInc)
def title = column[String]("TITLE")
def publicKey = column[String]("PUBLIC_KEY")
def * = userName ~ sshKeyId ~ publicKey <> (SshKey, SshKey.unapply _)
def ins = userName ~ title ~ publicKey returning sshKeyId
def * = userName ~ sshKeyId ~ title ~ publicKey <> (SshKey, SshKey.unapply _)
def byPrimaryKey(userName: String, sshKeyId: Int) = (this.userName is userName.bind) && (this.sshKeyId is sshKeyId.bind)
}
@@ -14,5 +17,6 @@ object SshKeys extends Table[SshKey]("SSH_KEY") {
case class SshKey(
userName: String,
sshKeyId: Int,
title: String,
publicKey: String
)