From def9aa429383a1530acceec3969c2589ab4add64 Mon Sep 17 00:00:00 2001 From: jr-rk <95219754+jr-rk@users.noreply.github.com> Date: Tue, 11 Aug 2026 15:58:40 +0200 Subject: [PATCH] fix(db): drop hardcoded `public.` schema prefix from CLARIN migrations The V7.2 Lindat/Clarin and V7.6 Preview migrations qualified their `ALTER TABLE ... OWNER TO dspace` statements with `public.`, so instances whose DSpace tables live in a non-public schema could not run them. Remove the qualifier (17 statements across the two files) so each resolves against the connection's search_path. The unrelated bitstore.xml storage-bean swap from the source commit is omitted -- dtq-dev already uses SyncBitstreamStorageServiceImpl. Port of dataquest-dev/dspace-customers#903 (item 5). Source: customer/vsb-tuo e2fb08358e. Co-Authored-By: Claude Fable 5 --- ...07.28__Upgrade_to_Lindat_Clarin_schema.sql | 28 +++++++++---------- .../V7.6_2024.08.05__Added_Preview_Tables.sql | 6 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.2_2022.07.28__Upgrade_to_Lindat_Clarin_schema.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.2_2022.07.28__Upgrade_to_Lindat_Clarin_schema.sql index d056e15b947..319db02003d 100644 --- a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.2_2022.07.28__Upgrade_to_Lindat_Clarin_schema.sql +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.2_2022.07.28__Upgrade_to_Lindat_Clarin_schema.sql @@ -31,7 +31,7 @@ CREATE TABLE license_definition ( required_info varchar(256) ); -ALTER TABLE public.license_definition OWNER TO dspace; +ALTER TABLE license_definition OWNER TO dspace; -- -- Name: license_definition_license_id_seq; Type: SEQUENCE; Schema: public; Owner: dspace @@ -44,7 +44,7 @@ CREATE SEQUENCE license_definition_license_id_seq NO MINVALUE CACHE 1; -ALTER TABLE public.license_definition_license_id_seq OWNER TO dspace; +ALTER TABLE license_definition_license_id_seq OWNER TO dspace; -- -- Name: license_definition_license_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dspace @@ -65,7 +65,7 @@ CREATE TABLE license_label ( ); -ALTER TABLE public.license_label OWNER TO dspace; +ALTER TABLE license_label OWNER TO dspace; -- -- Name: license_label_extended_mapping; Type: TABLE; Schema: public; Owner: dspace; Tablespace: @@ -77,7 +77,7 @@ CREATE TABLE license_label_extended_mapping ( label_id integer ); -ALTER TABLE public.license_label_extended_mapping OWNER TO dspace; +ALTER TABLE license_label_extended_mapping OWNER TO dspace; -- -- Name: license_label_extended_mapping_mapping_id_seq; Type: SEQUENCE; Schema: public; Owner: dspace @@ -91,7 +91,7 @@ CREATE SEQUENCE license_label_extended_mapping_mapping_id_seq CACHE 1; -ALTER TABLE public.license_label_extended_mapping_mapping_id_seq OWNER TO dspace; +ALTER TABLE license_label_extended_mapping_mapping_id_seq OWNER TO dspace; -- -- Name: license_label_extended_mapping_mapping_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dspace @@ -118,7 +118,7 @@ CREATE SEQUENCE license_label_label_id_seq CACHE 1; -ALTER TABLE public.license_label_label_id_seq OWNER TO dspace; +ALTER TABLE license_label_label_id_seq OWNER TO dspace; -- -- Name: license_label_label_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dspace @@ -144,7 +144,7 @@ CREATE TABLE license_resource_mapping ( ); -ALTER TABLE public.license_resource_mapping OWNER TO dspace; +ALTER TABLE license_resource_mapping OWNER TO dspace; -- -- Name: license_resource_mapping_mapping_id_seq; Type: SEQUENCE; Schema: public; Owner: dspace @@ -158,7 +158,7 @@ CREATE SEQUENCE license_resource_mapping_mapping_id_seq CACHE 1; -ALTER TABLE public.license_resource_mapping_mapping_id_seq OWNER TO dspace; +ALTER TABLE license_resource_mapping_mapping_id_seq OWNER TO dspace; -- -- Name: license_resource_mapping_mapping_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dspace @@ -186,7 +186,7 @@ CREATE TABLE license_resource_user_allowance ( token varchar(256) ); -ALTER TABLE public.license_resource_user_allowance OWNER TO dspace; +ALTER TABLE license_resource_user_allowance OWNER TO dspace; -- -- Name: license_resource_user_allowance_transaction_id_seq; Type: SEQUENCE; Schema: public; Owner: dspace @@ -199,7 +199,7 @@ CREATE SEQUENCE license_resource_user_allowance_transaction_id_seq NO MINVALUE CACHE 1; -ALTER TABLE public.license_resource_user_allowance_transaction_id_seq OWNER TO dspace; +ALTER TABLE license_resource_user_allowance_transaction_id_seq OWNER TO dspace; -- -- Name: license_resource_user_allowance_transaction_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dspace @@ -224,7 +224,7 @@ CREATE TABLE user_registration ( confirmation boolean DEFAULT true ); -ALTER TABLE public.user_registration OWNER TO dspace; +ALTER TABLE user_registration OWNER TO dspace; CREATE SEQUENCE user_registration_user_registration_id_seq START WITH 1 @@ -233,7 +233,7 @@ CREATE SEQUENCE user_registration_user_registration_id_seq NO MINVALUE CACHE 1; -ALTER TABLE public.user_registration_user_registration_id_seq OWNER TO dspace; +ALTER TABLE user_registration_user_registration_id_seq OWNER TO dspace; -- -- Name: user_registration_user_registration_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dspace @@ -254,7 +254,7 @@ CREATE TABLE user_metadata ( ); -ALTER TABLE public.user_metadata OWNER TO dspace; +ALTER TABLE user_metadata OWNER TO dspace; -- -- Name: user_metadata_user_metadata_id_seq; Type: SEQUENCE; Schema: public; Owner: dspace @@ -268,7 +268,7 @@ CREATE SEQUENCE user_metadata_user_metadata_id_seq CACHE 1; -ALTER TABLE public.user_metadata_user_metadata_id_seq OWNER TO dspace; +ALTER TABLE user_metadata_user_metadata_id_seq OWNER TO dspace; -- -- Name: user_metadata_user_metadata_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dspace diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2024.08.05__Added_Preview_Tables.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2024.08.05__Added_Preview_Tables.sql index 57919fbfa8e..74b677d73fd 100644 --- a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2024.08.05__Added_Preview_Tables.sql +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2024.08.05__Added_Preview_Tables.sql @@ -19,7 +19,7 @@ CREATE TABLE previewcontent ( size varchar(256) ); -ALTER TABLE public.previewcontent OWNER TO dspace; +ALTER TABLE previewcontent OWNER TO dspace; -- -- Name: previewcontent_previewcontent_id_seq; Type: SEQUENCE; Schema: public; Owner: dspace @@ -32,7 +32,7 @@ CREATE SEQUENCE previewcontent_previewcontent_id_seq NO MINVALUE CACHE 1; -ALTER TABLE public.previewcontent_previewcontent_id_seq OWNER TO dspace; +ALTER TABLE previewcontent_previewcontent_id_seq OWNER TO dspace; -- -- Name: previewcontent_previewcontent_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: dspace @@ -64,7 +64,7 @@ CREATE TABLE preview2preview ( name varchar(2000) ); -ALTER TABLE public.preview2preview OWNER TO dspace; +ALTER TABLE preview2preview OWNER TO dspace; -- -- Name: preview2preview_pkey; Type: CONSTRAINT; Schema: public; Owner: dspace; Tablespace: