Skip to content

Commit

Permalink
Merge pull request #176 from avantifellows/feature/add-region-column-…
Browse files Browse the repository at this point in the history
…to-user

Adding region column to user table
  • Loading branch information
Bahugunajii authored Aug 22, 2024
2 parents dea79d8 + f0418c8 commit 1f93a11
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/dbservice/users/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ defmodule Dbservice.Users.User do
field(:city, :string)
field(:district, :string)
field(:state, :string)
field(:region, :string)
field(:pincode, :string)
field(:role, :string)
field(:country, :string)
Expand Down Expand Up @@ -53,6 +54,7 @@ defmodule Dbservice.Users.User do
:city,
:district,
:state,
:region,
:pincode,
:role,
:whatsapp_phone,
Expand Down
2 changes: 2 additions & 0 deletions lib/dbservice_web/views/user_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ defmodule DbserviceWeb.UserView do
city: user.city,
district: user.district,
state: user.state,
region: user.region,
pincode: user.pincode,
role: user.role,
whatsapp_phone: user.whatsapp_phone,
Expand All @@ -45,6 +46,7 @@ defmodule DbserviceWeb.UserView do
city: user.city,
district: user.district,
state: user.state,
region: user.region,
pincode: user.pincode,
whatsapp_phone: user.whatsapp_phone,
date_of_birth: user.date_of_birth,
Expand Down
9 changes: 9 additions & 0 deletions priv/repo/migrations/20240614052711_update_user_table.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defmodule Dbservice.Repo.Migrations.UpdateUserTable do
use Ecto.Migration

def change do
alter table(:user) do
add :region, :string
end
end
end

0 comments on commit 1f93a11

Please sign in to comment.