Raising exception if patch already applied is sometimes undesirable
Would be great if, as an option,
register_patch() could return true or false, rather than raising an error when the patch is already applied. Otherwise the calling code needs to be able to differentiate between already applied and hard failures.
Use case would be
BEGIN; DO $patch$ BEGIN IF _v.try_register_patch('patch-001', ARRAY['patch-000'], NULL) THEN ALTER TABLE mytable ALTER COLUMN col1 TYPE VARCHAR(32); ALTER TABLE mytable2 RENAME col2 TO col2b; END IF; END$patch$; COMMIT;
Potential patch attached install.versioning.sql.patch