From 0853654fd55edff7a74bd2d31f7241fd94a1f577 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Wed, 3 Jan 2024 23:18:13 +0100 Subject: [PATCH] Set user login column to unique --- src/main/kotlin/com/example/demo/entities/User.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/com/example/demo/entities/User.kt b/src/main/kotlin/com/example/demo/entities/User.kt index b9e752f..4637485 100644 --- a/src/main/kotlin/com/example/demo/entities/User.kt +++ b/src/main/kotlin/com/example/demo/entities/User.kt @@ -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; } \ No newline at end of file