diff --git a/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/note/JdbcNoteStore.java b/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/note/JdbcNoteStore.java index 2e6eec1ebcc..dddbad49369 100644 --- a/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/note/JdbcNoteStore.java +++ b/dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/note/JdbcNoteStore.java @@ -94,7 +94,7 @@ private long saveNote(@Nonnull Note note, @Nonnull UserDetails user) { String sql = """ INSERT INTO public.note(noteid, notetext, creator, lastupdatedby, uid, created) - VALUES (nextVal('note_id_sequence'), + VALUES (nextVal('note_sequence'), :text, :creator, (select userinfoid from userinfo where uid = :lastUpdatedBy), diff --git a/dhis-2/dhis-support/dhis-support-db-migration/src/main/resources/org/hisp/dhis/db/migration/2.42/V2_42_34__Create_sequence_for_note_table.sql b/dhis-2/dhis-support/dhis-support-db-migration/src/main/resources/org/hisp/dhis/db/migration/2.42/V2_42_34__Create_sequence_for_note_table.sql index 4b89b4e8ccf..8e747326ecb 100644 --- a/dhis-2/dhis-support/dhis-support-db-migration/src/main/resources/org/hisp/dhis/db/migration/2.42/V2_42_34__Create_sequence_for_note_table.sql +++ b/dhis-2/dhis-support/dhis-support-db-migration/src/main/resources/org/hisp/dhis/db/migration/2.42/V2_42_34__Create_sequence_for_note_table.sql @@ -1,5 +1,5 @@ -create sequence if not exists note_id_sequence; -select setval('note_id_sequence', coalesce((select max(noteid) from note), 1)) FROM note; +create sequence if not exists note_sequence; +select setval('note_sequence', coalesce((select max(noteid) from note), 1)) FROM note; alter table if exists note drop column code; alter table if exists note drop column lastupdated; \ No newline at end of file