NitorCreations / nflow

Embeddable JVM-based workflow engine with high availability, fault tolerance, and support for multiple databases. Additional libraries are provided for visualization and REST API.
203 stars 39 forks source link

postgres change SQL column type from int to big int #643

Closed RealZimboGuy closed 1 month ago

RealZimboGuy commented 5 months ago

in reference to the postgres database initialise script. is it possible to change the two main references from SERIAL to BIGSERIAL the SERIAL is limited to the standard signed 32 byte integer value of 2,147,483,647. this is more an issue for the workflow actions as a large number of actions brings the max workflows you can potentially have. ie in the case of 40 actions you have a max workflows of 53,687,091

    create table if not exists nflow_workflow_action (
      id serial not null,

and

    create table if not exists nflow_workflow (
      id serial primary key,

the archive tables will also need to be updated.

I could have a look at testing the change and doing a PR ?

gmokki commented 5 months ago

The code already handles everything as 64bit numbers so you can just do that change locally, even on the fly. But do remember that you need to also do the same for the history tables, if archiving is enabled.

RealZimboGuy commented 5 months ago

@gmokki thanks, yeah that can be done. i was just thinking of changing the defaults. but, its not an issue many people should face.

gmokki commented 5 months ago

Yes. I think we definitely should be considering changing the defaults. At least for the action table.

RealZimboGuy commented 3 months ago

Hi @gmokki , I have submitted a PR for this.

RealZimboGuy commented 1 month ago

change merged