Skip to content

Instantly share code, notes, and snippets.

@t3hnar
Created May 24, 2012 11:47
Show Gist options
  • Save t3hnar/2780988 to your computer and use it in GitHub Desktop.
Save t3hnar/2780988 to your computer and use it in GitHub Desktop.
object ConnectorTypes extends Table[(String, ConnectorType.Value)]("connector_type") {
implicit val ConnectorTypeMapper = new EnumMappedTypeMapper(ConnectorType)
def chargerId = column[String]("charger_id")
def connectorType = column[ConnectorType.Value]("connector_type")
def * = chargerId ~ connectorType
def ux = index("ux_connector_type", chargerId ~ connectorType, unique = true)
def fkCharger = foreignKey("fk_connector_types_charger", chargerId, Charger)(_.id)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment