[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:
15
priv/repo/migrations/20210622015725_create_users_table.exs
Normal file
15
priv/repo/migrations/20210622015725_create_users_table.exs
Normal 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
|
Reference in New Issue
Block a user