[day-02] add user schema and migration

Add elixir struct to represent an user and its corresponding
representation on the database.
This commit is contained in:
Joao P Dubas
2021-06-22 23:55:02 +00:00
parent cebce7da42
commit 97af827bc2
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
defmodule Wabanex.Repo.Migrations.CreateUsersTable do
use Ecto.Migration
def change do
create table(:users) do
add :email, :string
add :name, :string
add :password, :string
timestamps()
end
create unique_index(:users, [:email])
end
end