Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update annotation table #143

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/main/java/eu/dissco/backend/database/jooq/Indexes.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/main/java/eu/dissco/backend/database/jooq/Keys.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/main/java/eu/dissco/backend/database/jooq/Public.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ public Optional<Annotation> getActiveAnnotationForUser(String id, String userId)
return context.select(ANNOTATION.asterisk())
.from(ANNOTATION)
.where(ANNOTATION.ID.eq(id))
.and(ANNOTATION.CREATOR_ID.eq(userId))
.and(ANNOTATION.TOMBSTONED_ON.isNull())
.and(ANNOTATION.CREATOR.eq(userId))
.and(ANNOTATION.TOMBSTONED.isNull())
.fetchOptional(this::mapToAnnotation);
}

public List<Annotation> getForTarget(String id) {
return context.select(ANNOTATION.DATA)
.from(ANNOTATION)
.where(ANNOTATION.TARGET_ID.eq(id))
.and(ANNOTATION.TOMBSTONED_ON.isNull())
.and(ANNOTATION.TOMBSTONED.isNull())
.fetch(this::mapToAnnotation);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void testNullResponse() throws Exception {
.set(ANNOTATION.MOTIVATION, annotation.getOaMotivation().value())
.set(ANNOTATION.MJR_JOB_ID, annotation.getOdsJobID())
.set(ANNOTATION.BATCH_ID, annotation.getOdsBatchID())
.set(ANNOTATION.CREATOR_ID, annotation.getDctermsCreator().getId())
.set(ANNOTATION.CREATOR, annotation.getDctermsCreator().getId())
.set(ANNOTATION.CREATED, annotation.getDctermsCreated().toInstant())
.set(ANNOTATION.MODIFIED, annotation.getDctermsModified().toInstant())
.set(ANNOTATION.LAST_CHECKED, annotation.getDctermsCreated().toInstant())
Expand All @@ -145,7 +145,7 @@ private void postAnnotations(List<Annotation> annotations) throws JsonProcessing
.set(ANNOTATION.MOTIVATION, annotation.getOaMotivation().value())
.set(ANNOTATION.MJR_JOB_ID, annotation.getOdsJobID())
.set(ANNOTATION.BATCH_ID, annotation.getOdsBatchID())
.set(ANNOTATION.CREATOR_ID, annotation.getDctermsCreator().getId())
.set(ANNOTATION.CREATOR, annotation.getDctermsCreator().getId())
.set(ANNOTATION.CREATED, annotation.getDctermsCreated().toInstant())
.set(ANNOTATION.MODIFIED, annotation.getDctermsModified().toInstant())
.set(ANNOTATION.LAST_CHECKED, annotation.getDctermsCreated().toInstant())
Expand All @@ -157,7 +157,7 @@ private void postAnnotations(List<Annotation> annotations) throws JsonProcessing
.set(ANNOTATION.MOTIVATION, annotation.getOaMotivation().value())
.set(ANNOTATION.MJR_JOB_ID, annotation.getOdsJobID())
.set(ANNOTATION.BATCH_ID, annotation.getOdsBatchID())
.set(ANNOTATION.CREATOR_ID, annotation.getDctermsCreator().getId())
.set(ANNOTATION.CREATOR, annotation.getDctermsCreator().getId())
.set(ANNOTATION.CREATED, annotation.getDctermsCreated().toInstant())
.set(ANNOTATION.MODIFIED, annotation.getDctermsModified().toInstant())
.set(ANNOTATION.LAST_CHECKED, annotation.getDctermsCreated().toInstant())
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/db/migration/V1__init_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ create table annotation
motivation text not null,
mjr_job_id text,
batch_id uuid,
creator_id text not null,
creator text not null,
created timestamp with time zone not null,
modified timestamp with time zone not null,
last_checked timestamp with time zone not null,
tombstoned_on timestamp with time zone,
tombstoned timestamp with time zone,
target_id text not null,
data jsonb
);
Expand Down
Loading