Open adamkorynta opened 10 months ago
Capturing my recollection of where we got to when we looked into this. The way the CWMS jOOQ codegen is done is that its done on a database that didn't have the needed flags. For some technical reason jOOQ can't inspect an already built schema after the fact and something needed to be set on the database before it was built. The reason the flag is needed is a technical jOOQ thing and not something we're gonna change. I'm not sure why CWMS isn't setting the flag but I suspect that it isn't going to be added to the normal CWMS schema.
So if we absolutely need the flag we need to change the way we do codegen so that its done inside a Docker image that builds a fresh database from the database release BUT sets the needed flag before the schema install happens.
Technically might be possible to do but it doesn't seem worth the effort just to get a couple constants.
Am I remembering this right?
Mostly right, currently we already are are performing the codegen on a Docker container with a fresh database. I opted to not update the codegen process to set the flag, rather, update the schema installer to just always set the flag (given the above reasons of it only being a couple of constants so no need for a quicker turnaround just in the codegen). I have a PR already for this, but want to get some unit tests going. This is on my active TODO.
The latest CWMS schema does not include the correct compiler settings for jOOQ to generate these. See PR: https://bitbucket.hecdev.net/projects/CWMS/repos/cwms_database/pull-requests/318/diff#schema%2Fsrc%2FbuildCWMS_DB.sql