mirror of
https://github.com/kevin-DL/phoenix_api_template.git
synced 2026-01-11 18:54:33 +00:00
16 lines
409 B
Elixir
16 lines
409 B
Elixir
defmodule PhoenixApiTemplate.Repo.Migrations.CreateProfiles do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:profiles, primary_key: false) do
|
|
add(:id, :binary_id, primary_key: true)
|
|
add(:display_name, :string)
|
|
add(:user_id, references(:users, on_delete: :delete_all, type: :binary_id))
|
|
|
|
timestamps()
|
|
end
|
|
|
|
create(index(:profiles, [:user_id, :display_name]))
|
|
end
|
|
end
|