Skip to content

Commit

Permalink
create user_agents and login_logs tables, #67
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonLab committed May 18, 2020
1 parent 7cd531f commit 6522cc0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions priv/repo/migrations/20200518135714_login_log.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
defmodule Auth.Repo.Migrations.LoginLog do
use Ecto.Migration

def change do
create table(:user_agents) do
add :user_agent, :binary
end

create table(:login_logs) do
add :email, :binary
add :ip_address, :binary
add :person_id, references(:people, on_delete: :nothing)
add :user_agent_id, references(:user_agents, on_delete: :nothing)

timestamps()
end

create index(:login_logs, [:person_id])
create index(:login_logs, [:user_agent_id])
end
end

0 comments on commit 6522cc0

Please sign in to comment.