Update migrations
This commit is contained in:
parent
50abfe4748
commit
57efda7638
12 changed files with 56 additions and 35 deletions
20
priv/repo/migrations/20250615131158_create_users.exs
Normal file
20
priv/repo/migrations/20250615131158_create_users.exs
Normal file
|
@ -0,0 +1,20 @@
|
|||
defmodule Nulla.Repo.Migrations.CreateUsers do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:users, primary_key: false) do
|
||||
add :id, :bigint, primary_key: true
|
||||
add :email, :string
|
||||
add :password, :string
|
||||
add :privateKeyPem, :string
|
||||
add :last_active_at, :utc_datetime
|
||||
|
||||
add :actor_id, references(:actors, column: :id, type: :bigint, on_delete: :delete_all),
|
||||
null: false
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
create unique_index(:users, [:actor_id])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue