diff --git a/backend/docs/db/schema.sql b/backend/docs/db/schema.sql index 426a7f41d..4230c9023 100644 --- a/backend/docs/db/schema.sql +++ b/backend/docs/db/schema.sql @@ -738,6 +738,13 @@ CREATE INDEX user_groups_table_user_name_idx ON public.user_groups_table USING b CREATE TRIGGER update_tracker_trigger AFTER INSERT OR DELETE OR UPDATE OR TRUNCATE ON public.current_processing_pipeline FOR EACH STATEMENT EXECUTE FUNCTION public.update_table_tracker(); +-- +-- Name: data_use_terms_table update_tracker_trigger; Type: TRIGGER; Schema: public; Owner: postgres +-- + +CREATE TRIGGER update_tracker_trigger AFTER INSERT OR DELETE OR UPDATE OR TRUNCATE ON public.data_use_terms_table FOR EACH STATEMENT EXECUTE FUNCTION public.update_table_tracker(); + + -- -- Name: external_metadata update_tracker_trigger; Type: TRIGGER; Schema: public; Owner: postgres -- diff --git a/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt b/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt index 4d8ade75e..af84d15c2 100644 --- a/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt +++ b/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt @@ -12,6 +12,7 @@ import org.loculus.backend.api.Organism import org.loculus.backend.api.ProcessedData import org.loculus.backend.api.VersionStatus import org.loculus.backend.config.BackendConfig +import org.loculus.backend.service.datauseterms.DATA_USE_TERMS_TABLE_NAME import org.loculus.backend.service.groupmanagement.GROUPS_TABLE_NAME import org.loculus.backend.service.submission.CURRENT_PROCESSING_PIPELINE_TABLE_NAME import org.loculus.backend.service.submission.EXTERNAL_METADATA_TABLE_NAME @@ -41,6 +42,7 @@ val RELEASED_DATA_RELATED_TABLES: List = SEQUENCE_ENTRIES_TABLE_NAME, SEQUENCE_ENTRIES_PREPROCESSED_DATA_TABLE_NAME, SEQUENCE_UPLOAD_AUX_TABLE_NAME, + DATA_USE_TERMS_TABLE_NAME, ) @Service diff --git a/backend/src/main/resources/db/migration/V1.7__add_table_update_trigger_for_data_use_terms.sql b/backend/src/main/resources/db/migration/V1.7__add_table_update_trigger_for_data_use_terms.sql new file mode 100644 index 000000000..6673e8ebb --- /dev/null +++ b/backend/src/main/resources/db/migration/V1.7__add_table_update_trigger_for_data_use_terms.sql @@ -0,0 +1 @@ +SELECT create_update_trigger_for_table('data_use_terms_table');