TechnologyRediscovery / codenforce

municipal code enforcement database application
GNU General Public License v3.0
2 stars 3 forks source link

Create a Database function that returns a release version #215

Open edarsow opened 2 years ago

edarsow commented 2 years ago

Write a PL/SQL script that reads from the table dbpatch and also runs scripts to verify the current state of a user's test or live database.

The postgres documentation on PL/SQL and triggers can be used for reference

So what we want is for users to be able to run a DB patch like patch 35 and this should make an entry in dbpatch. We want a function called something like check_db_release() that will query the dbpatch table, sort by patch release date, and return the most recent correctly run patch.

Database upgrade integrity checks

Perhaps our patches need to make logs to a status table more frequently than just at the end. Such as, checking at the end of the patch if the changes actually wrote, and only on verification does an OK status code get written to a patch log. Otherwise, the function could write an incomplete code of some kind.