icatproject / icat.server

The ICAT server offering both SOAP and "RESTlike" interfaces to a metadata catalog.
Other
1 stars 5 forks source link

Drop SQL upgrade scripts #291

Closed RKrahl closed 2 years ago

RKrahl commented 2 years ago

As discussed in the meeting on 19th May, we might want to drop the SQL upgrade scripts and rely on the initialization in icat.server provided by EclipseLink to upgrade the database instead.

This PR changes the eclipselink.ddl-generation setting from create-tables to create-or-extend-tables and drops the SQL upgrade scripts for version 5.0. The EclipseLink setting has the effect that the initialization code will not only add missing tables, but also add missing columns to existing tables.

Note that this works for simple additive schema changes as we had in recent versions and we envision for 5.0. More complex schema changes such as those discussed in #231 or #254 can not be covered automatically by the EclipseLink initialization and will still require dedicated upgrade scripts.

I tested this with MariaDB for the upgrade from 4.11.1 to 5.0 (the current icat-schema-extension branch). I even tested an upgrade from icat.server 4.7.0 to 5.0 in one single step without running any upgrade scripts. This works as well with one noteworthy exception: the EclipseLink initialization did not create the index on Datafile.location added in version 4.8. But our SQL upgrade scripts didn't care to do that either.

@kevinphippsstfc, could you please test this with Oracle?

RKrahl commented 2 years ago

I realised that the installation HTML file also needs updating to reflect the fact that there are no longer upgrade files but that the schema upgrade for this version is automatic upon installation.

I wonder how we should deal with the schema upgrade instructions for very old (older than 4.7.0) versions. These would still require a stepwise upgrade from version to version with manual interventions in each step as described in the install instructions in 4.7.0 (and still in the current release). Should we keep these instructions?

I'd assume that in the meanwhile nobody is using that old versions in production anyway. So I'd be inclined to take the opportunity to drop these old instructions and simply state that direct upgrade is supported for ICAT 4.7.0 and newer. For older versions, one should first upgrade to 4.7.0 following the instructions provided with that version and then upgrade to 5.0.0 in a second step. Upgrade from 4.7.0 or newer is covered by the automatic initialization provided by EclipseLink.

RKrahl commented 2 years ago

I now dropped all old upgrade scripts and updated the install instructions as outlined in the last comment. Please have a look.