defmodule WorkloadService.Repo.Migrations.CreateTasks do use Ecto.Migration def change do create table(:tasks, primary_key: false) do add :id, :string, primary_key: true add :org_id, :string, null: false add :application_id, :string, null: false add :provider_id, :string, null: false add :provider_name, :string add :task_info, :map, default: %{} add :submission, :map add :attachments, {:array, :string}, default: [] add :status, :string, null: false, default: "created" add :version, :integer, default: 1 timestamps type: :utc_datetime end create index(:tasks, [:application_id]) create index(:tasks, [:org_id]) create index(:tasks, [:provider_id]) create index(:tasks, [:status]) end end