N8n upgrade postgresql migration fix

The idea is:

After upgrading from 1.3x to 1.8x, n8n main process and workers face the timeout problem when connecting to n8n postgresql database. we added below index to execution_entity table in order to increase query speed and get rid of timeout problem. For that reason, it would be helpfull to add below index to migration scripts.

My use case:

We encountered problem after upgrading from 1.3x to 1.8x version. Our main process and workers got timeout when connecting to postgresql n8n database.

I think it would be beneficial to add this because:

We added below index to fasten queries which resulted from > 20sn to <1sn
CREATE INDEX CONCURRENTLY idx_execution_entity_workflow_id_status_startedAt ON public.execution_entity (“workflowId” ,“status”, “startedAt” desc) WHERE “deletedAt” IS NULL;