Files
workload-service/priv/repo/migrations/20240101000001_create_tasks.exs
HaimKortovich 7a7475ef13
All checks were successful
Build and Publish / build-release (push) Successful in 1m34s
fix query helpers and add policy type to projections
2026-04-22 15:28:48 -05:00

24 lines
716 B
Elixir

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(:policy_type, :string)
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]))
create(index(:tasks, [:policy_type]))
end
end