OneToMany relationship between workflow and execution

Hi there, Hope you all are doing great.

Recently I checked the tags update and see there is a typeorm relationship between workflow and tags, I wonder why there isn’t any typeorm relationship between workflow and execution, since these two can have oneToMany relationship.
Is there any reason to avoid this approach?

Thanks

Even thought there is not a relationship in TypeORM (Explicitly as a decorator), in the database the execution table includes the ID of the workflow. With that, you can retrieve all the executing of a particular workflow.

Why is not using the @OneToMany or @ManyToOne decorator I do not know. Perhaps, @jan has a better insight here.

1 Like

Thanks for the response, Yes I knew that there is real database relationship between those two.
So best to wait for @jan .

I did write that code 2-3 years ago so do not really know that anymore. Probably had something to do with speed. Think there was some kind issue with TypeORM that I had to always give it a loaded instance, or it always loaded it on query, or something else that would have unnecessarily increased the number of DB requests.
But as mentioned do not remember anymore and also do not know if that still holds true today as obviously also TypeORM received a lot of updates. Do not think we have any disadvantages because of that right now so do not see a reason to change that or spend any time in even checking unless there is a really good reason to do so. It works perfectly fine right now, so better spend resources on something that makes a difference.

Sorry, simply to much time went by to give a specific answer.

2 Likes

Thanks @jan it was a complete explanation, really appreciate that.

1 Like

At least complete in a sense what I remember, not in actual containing the exact reason :wink:

1 Like

Also complete from my point of view :grinning_face_with_smiling_eyes:

1 Like