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(:task_info, :map, default: %{}) add(:submission, :map) add(:attachments, {:array, :string}, default: []) add(:status, :string, null: false, default: "created") timestamps(type: :utc_datetime) end create(index(:tasks, [:application_id])) create(index(:tasks, [:org_id])) create(index(:tasks, [:status])) end end