Skip to content

Commit

Permalink
fix(jdbc): add missing id column on the execution table (#1076)
Browse files Browse the repository at this point in the history
close #1072
  • Loading branch information
loicmathieu authored Mar 17, 2023
1 parent 3a5b08e commit 1b5791d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.kestra.core.models.tasks.ResolvedTask;
import io.kestra.core.tasks.debugs.Return;
import io.micronaut.data.model.Pageable;
import io.micronaut.data.model.Sort;
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -113,6 +114,18 @@ protected void find() {
assertThat(executions.getTotal(), is(8L));
}

@Test
protected void findWithSort() {
inject();

ArrayListTotal<Execution> executions = executionRepository.find(Pageable.from(1, 10, Sort.of(Sort.Order.desc("id"))), null, null, null, null, null, null);
assertThat(executions.getTotal(), is(28L));
assertThat(executions.size(), is(10));

executions = executionRepository.find(Pageable.from(1, 10), null, null, null, null, null, List.of(State.Type.RUNNING, State.Type.FAILED));
assertThat(executions.getTotal(), is(8L));
}

@Test
protected void findTaskRun() {
inject();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE executions ADD COLUMN "id" VARCHAR(150) NOT NULL GENERATED ALWAYS AS (JQ_STRING("value", '.id'))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE executions ADD COLUMN id VARCHAR(150) NOT NULL GENERATED ALWAYS AS (value ->> 'id') STORED

0 comments on commit 1b5791d

Please sign in to comment.