Set user login column to unique

This commit is contained in:
Florian RICHER 2024-01-03 23:18:13 +01:00
parent b998bb7101
commit 0853654fd5

View file

@ -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;
}