Set user login column to unique
This commit is contained in:
parent
b998bb7101
commit
0853654fd5
1 changed files with 2 additions and 0 deletions
|
@ -2,6 +2,7 @@ package com.example.demo.entities
|
|||
|
||||
import io.quarkus.hibernate.orm.panache.kotlin.PanacheCompanion
|
||||
import io.quarkus.hibernate.orm.panache.kotlin.PanacheEntity
|
||||
import jakarta.persistence.Column
|
||||
import jakarta.persistence.Entity
|
||||
import jakarta.validation.constraints.Email
|
||||
import jakarta.validation.constraints.NotEmpty
|
||||
|
@ -12,5 +13,6 @@ class User : PanacheEntity() {
|
|||
|
||||
@NotEmpty(message = "Login can't be empty")
|
||||
@Email(message = "The email address is invalid.")
|
||||
@Column(unique = true)
|
||||
lateinit var login: String;
|
||||
}
|
Loading…
Reference in a new issue