diff --git a/CHANGELOG.md b/CHANGELOG.md index 713e88c61a..8791642740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ and this project adheres to [#2718](https://github.com/OpenFn/lightning/issues/2718) - Temporary instrumentation for JobEditor to help identify performance issues. [#2617](https://github.com/OpenFn/lightning/issues/2617) +- Indexes to foreign keys on `workflow_edges` and `steps` tables to try and + alleviate slow loading of the job editor. + [#2617](https://github.com/OpenFn/lightning/issues/2617) ### Changed diff --git a/priv/repo/migrations/20250122110318_index_workflow_id_on_workflow_edges.exs b/priv/repo/migrations/20250122110318_index_workflow_id_on_workflow_edges.exs new file mode 100644 index 0000000000..31c52a2ef7 --- /dev/null +++ b/priv/repo/migrations/20250122110318_index_workflow_id_on_workflow_edges.exs @@ -0,0 +1,7 @@ +defmodule Lightning.Repo.Migrations.IndexWorkflowIdOnWorkflowEdges do + use Ecto.Migration + + def change do + create_if_not_exists index(:workflow_edges, [:workflow_id]) + end +end diff --git a/priv/repo/migrations/20250122110504_index_job_id_on_steps.exs b/priv/repo/migrations/20250122110504_index_job_id_on_steps.exs new file mode 100644 index 0000000000..2110853b95 --- /dev/null +++ b/priv/repo/migrations/20250122110504_index_job_id_on_steps.exs @@ -0,0 +1,7 @@ +defmodule Lightning.Repo.Migrations.IndexJobIdOnSteps do + use Ecto.Migration + + def change do + create_if_not_exists index(:steps, [:job_id]) + end +end