Verified Commit 336c2c32 authored by Nicolas's avatar Nicolas

Add unique check constraint

parent 382cbdab
......@@ -24,6 +24,7 @@ defmodule PlasmaRepo.Users.User do
def changeset(user, attrs \\ %{}) do
user
|> cast(attrs, [:mx_user_id, :password, :password_hash, :kind])
|> unique_constraint(:mx_user_id, message: "unique")
|> validate_username()
|> validate_password()
#|> validate_required([:user_id, :password], message: "empty_user_id_or_password")
......
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 to comment