Skip to content

Instantly share code, notes, and snippets.

@leandrob13
Last active April 11, 2016 22:30
Show Gist options
  • Save leandrob13/a138794ee0feabe9c6e5523fb70ec700 to your computer and use it in GitHub Desktop.
Save leandrob13/a138794ee0feabe9c6e5523fb70ec700 to your computer and use it in GitHub Desktop.
package user.persistence.tables
object UserTables {
val driver = slick.driver.MySQLDriver
import driver.api._
class Users(tag: Tag) extends Table[UserRegister](tag, "USERS") {
val username: Rep[ String ] = column[ String ]( "USERNAME", O.PrimaryKey )
val name: Rep[ String ] = column[ String ]( "NAME" )
val lastname: Rep[ String ] = column[ String ]( "LASTNAME" )
val email: Rep[ String ] = column[ String ]( "EMAIL" )
val password: Rep[ String ] = column[ String ]( "PASSWORD" )
val active: Rep[ Boolean ] = column[ Boolean ]( "IS_ACTIVE" )
val confirmed: Rep[ Boolean ] = column[ Boolean ]( "IS_CONFIRMED" )
def * = ( username, name, lastname, email, password, active, confirmed ) <>
( UserRegister.tupled, UserRegister.unapply )
def idx = index( "idx_email", email, unique = true )
}
}
case class UserRegister( username: String, name: String, lastname: String, email: String, password: String,
active: Boolean, confirmed: Boolean )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment