A sufficiently old Evergreen database might still have tsearch2
exist as an unpackaged contrib, so convert it to an extension first.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
ALTER TABLE metabib.subject_field_entry ALTER COLUMN index_vector TYPE pg_catalog.tsvector;
ALTER TABLE metabib.title_field_entry ALTER COLUMN index_vector TYPE pg_catalog.tsvector;
+-- Make sure that tsearch2 exists as an extension (for a sufficiently
+-- old Evergreen database, it might still be an unpackaged contrib).
+CREATE EXTENSION IF NOT EXISTS tsearch2 SCHEMA public FROM unpackaged;
-- Halfway there! Goodbye tsearch2 extension!
DROP EXTENSION tsearch2;
ALTER TABLE metabib.subject_field_entry ALTER COLUMN index_vector TYPE pg_catalog.tsvector;
ALTER TABLE metabib.title_field_entry ALTER COLUMN index_vector TYPE pg_catalog.tsvector;
+-- Make sure that tsearch2 exists as an extension (for a sufficiently
+-- old Evergreen database, it might still be an unpackaged contrib).
+CREATE EXTENSION IF NOT EXISTS tsearch2 SCHEMA public FROM unpackaged;
-- Halfway there! Goodbye tsearch2 extension!
DROP EXTENSION tsearch2;