diff --git a/priv/repo/migrations/20180310155541_add_bgg_username_to_users.exs b/priv/repo/migrations/20180310155541_add_bgg_username_to_users.exs new file mode 100644 index 0000000..b201352 --- /dev/null +++ b/priv/repo/migrations/20180310155541_add_bgg_username_to_users.exs @@ -0,0 +1,9 @@ +defmodule Nermesterts.Repo.Migrations.AddBggUsernameToUsers do + use Ecto.Migration + + def change do + alter table(:users) do + add :bgg_username, :string + end + end +end diff --git a/web/models/user.ex b/web/models/user.ex index 5ccf608..1b75564 100644 --- a/web/models/user.ex +++ b/web/models/user.ex @@ -4,7 +4,7 @@ defmodule Nermesterts.User do alias Nermesterts.User @required_fields ~w(username)a - @optional_fields ~w(active admin guest name password password_confirmation)a + @optional_fields ~w(active admin bgg_username guest name password password_confirmation)a @all_fields @required_fields ++ @optional_fields @required_registration_fields ~w(username password password_confirmation)a @@ -14,6 +14,7 @@ defmodule Nermesterts.User do schema "users" do field :username, :string + field :bgg_username, :string field :crypted_password, :string field :password, :string, virtual: true field :password_confirmation, :string, virtual: true diff --git a/web/templates/user/form.html.eex b/web/templates/user/form.html.eex index 1653be0..ef02307 100644 --- a/web/templates/user/form.html.eex +++ b/web/templates/user/form.html.eex @@ -17,6 +17,12 @@ <%= error_tag f, :name %> +
+ <%= label f, :bgg_username, "BGG Username", class: "control-label" %> + <%= text_input f, :bgg_username, class: "form-control" %> + <%= error_tag f, :bgg_username %> +
+
<%= label f, :password, class: "control-label" %> <%= password_input f, :password, class: "form-control" %>