Last active
April 11, 2016 22:30
-
-
Save leandrob13/a138794ee0feabe9c6e5523fb70ec700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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