perf(UserDocument): añadida restricción de valor único a email y username

parent 65d66cfd
package com.example.apprecetas.user.infrastructure.repository.mongodb;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection = "users")
@Getter
@Setter
public class UserDocument {
@Id
@Column(name = "id_usuario")
private String id;
@Column(name = "nombre")
private String name;
@Column(name = "apellidos")
private String surname;
@Column(name = "email", unique = true)
@Indexed(unique = true)
private String email;
@Column(name = "password")
private String password;
@Column(name = "usuario", unique = true)
@Indexed(unique = true)
private String username;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment