memEx/priv/repo/migrations/20220726001809_create_steps.exs

21 lines
542 B
Elixir
Raw Permalink Normal View History

2022-07-25 20:18:39 -04:00
defmodule Memex.Repo.Migrations.CreateSteps do
use Ecto.Migration
def change do
create table(:steps, primary_key: false) do
add :id, :binary_id, primary_key: true
add :title, :string
2022-11-24 15:35:29 -05:00
add :content, :text
2022-07-25 20:18:39 -04:00
add :position, :integer
2022-11-24 15:35:29 -05:00
2022-07-25 20:18:39 -04:00
add :pipeline_id, references(:pipelines, on_delete: :nothing, type: :binary_id)
2022-11-24 15:35:29 -05:00
add :user_id, references(:users, on_delete: :nothing, type: :binary_id)
2022-07-25 20:18:39 -04:00
timestamps()
end
create index(:steps, [:pipeline_id])
2022-11-24 15:35:29 -05:00
create index(:steps, [:user_id])
2022-07-25 20:18:39 -04:00
end
end