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

Merge from BI server #1

Closed
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
7309c14
Merge pull request #7 from Breeding-Insight/release/0.7
nickpalladino Dec 14, 2022
0f40c8b
Update pom.xml
timparsons Dec 15, 2022
7383fac
Merge pull request #10 from Breeding-Insight/bug/BI-1781
nickpalladino Jun 27, 2023
7f64183
Merge branch 'plantbreeding/brapi-Java-TestServer:brapi-server-v2' in…
timparsons Jul 6, 2023
c23c0a9
[BI-1771] - performance experiments
mlm483 Aug 1, 2023
9a35d3f
[BI-1771] - added germplasm-related indexes
mlm483 Aug 3, 2023
e1f6cf9
[BI-1771] - reverted index annotation
mlm483 Aug 3, 2023
bf0cc00
[BI-1771] - reverted whitespace changes
mlm483 Aug 3, 2023
fb08a50
[BI-1771] - made create_indexes.sql idempotent
mlm483 Aug 14, 2023
deb9572
[BI-1771] - set hibernate.ddl-auto to create-only
mlm483 Aug 15, 2023
43c67e6
Merge pull request #11 from Breeding-Insight/bug/BI-1771
mlm483 Aug 18, 2023
5a29d77
Merging release v0.8
timparsons Aug 22, 2023
7fce804
[BI-1909] Exploring converting *ToOne relationships to lazy loading a…
timparsons Sep 13, 2023
441814a
[BI-1909] NPE fix, converting sysouts to use Logger
timparsons Sep 15, 2023
0f9ec46
[BI-1909] Updating GermplasmService to eagerly fetch related date for…
timparsons Sep 19, 2023
57da450
[BI-1909] suggested changes
timparsons Sep 22, 2023
504e1de
Merge pull request #14 from Breeding-Insight/bug/BI-1909
timparsons Sep 25, 2023
8f4d7b1
Merge branch 'release/0.8.1' into develop
timparsons Sep 25, 2023
0e343c6
Merge pull request #15 from plantbreeding/brapi-server-v2
mlm483 Oct 23, 2023
fc92574
[BI-1945] - saving work in progress
mlm483 Oct 24, 2023
9bc8ade
[BI-1945] - store additionalInfo on primary entities as JSONB
mlm483 Oct 25, 2023
65f061d
[BI-1945] - optimized imports
mlm483 Oct 25, 2023
4789ff9
[BI-1945] - updated template, readme
mlm483 Oct 26, 2023
fdcca4d
[BI-1945] - cleaned up SQL dummy data migrations
mlm483 Oct 26, 2023
3e2e3a0
[BI-1945] - updated template
mlm483 Oct 26, 2023
0690839
[BI-1945] - removed unused class
mlm483 Oct 26, 2023
ed01390
[BI-1945] - renamed method
mlm483 Oct 26, 2023
aa0f1a5
[BI-1945] - handled null case
mlm483 Oct 27, 2023
8bd3c32
[BI-1945] - added stringtype=unspecified to template
mlm483 Oct 27, 2023
03eedc4
[BI-1945] - removed debug log
mlm483 Nov 6, 2023
a1f546b
[BI-1945] - optimized imports
mlm483 Nov 6, 2023
b4ac393
[BI-1945] - removed additionalInfo joins
mlm483 Nov 6, 2023
0f0c6d2
[BI-1945] - updated README.md
mlm483 Nov 6, 2023
7efbb52
Merge pull request #18 from Breeding-Insight/release/0.8.1
mlm483 Nov 8, 2023
404343a
Create pull.yml
timparsons Nov 9, 2023
73923fa
Merge pull request #17 from Breeding-Insight/feature/BI-1945
mlm483 Nov 13, 2023
c537709
[BI-1945] - added ON DELETE CASCADE to xref linking tables
mlm483 Nov 14, 2023
57848e3
Merge pull request #20 from Breeding-Insight/feature/BI-1945-fix
mlm483 Nov 21, 2023
65bd99a
[BI-2040] The fetchScaleValidValueCategories() method was causing the…
davedrp Feb 5, 2024
4447807
[BI-2040] removed all calls to fetchXXXXX(page) and the methods thems…
davedrp Feb 5, 2024
22b5fdd
[BI-2040] removed unused import-statements from ObservationVariableSe…
davedrp Feb 5, 2024
1b6b9fb
[BI-2051] - batched inserts for efficiency
mlm483 Feb 6, 2024
f38b21e
[BI-2051] - removed comment
mlm483 Feb 8, 2024
28c33bc
Merge pull request #22 from Breeding-Insight/bug/BI-2051
mlm483 Feb 12, 2024
ed22fdd
Merge pull request #21 from Breeding-Insight/bug/BI-2040
davedrp Feb 12, 2024
0c5b914
Merge pull request #23 from plantbreeding/brapi-server-v2
mlm483 Feb 22, 2024
60d2cd2
[BI-2078] - made performance improvements (thanks BrapiCoordinatorSelby)
mlm483 Mar 11, 2024
a3e3835
Merge pull request #26 from Breeding-Insight/release/0.9
mlm483 Mar 12, 2024
dd070f7
Merge pull request #25 from Breeding-Insight/bug/BI-2078
mlm483 Mar 19, 2024
d295cfa
Merge pull request #27 from Breeding-Insight/bug/BI-2078
mlm483 Mar 19, 2024
e6a3d48
Merge pull request #28 from Breeding-Insight/release/0.9
mlm483 Apr 10, 2024
08a3b9d
Merge pull request #24 from plantbreeding/brapi-server-v2
mlm483 Apr 12, 2024
24dbf87
Merge pull request #29 from Breeding-Insight/release/0.9
mlm483 Apr 15, 2024
4452e8a
Filter out pedigree nodes with null germplasm
nickpalladino Apr 17, 2024
aaf7fbd
Updated comment
nickpalladino Apr 19, 2024
f9c8ca8
Merge pull request #30 from Breeding-Insight/helium-integration
nickpalladino May 2, 2024
b412589
Merge pull request #32 from Breeding-Insight/release/0.9.1
mlm483 Jun 5, 2024
6e53be5
[BI-2109] - added migration for datasets
mlm483 Jun 28, 2024
8e06edf
[BI-2109] - made migration safer
mlm483 Jul 2, 2024
31d1129
Merge pull request #33 from Breeding-Insight/feature/BI-2109
mlm483 Jul 10, 2024
4da5d94
Merge pull request #31 from plantbreeding/brapi-server-v2
pull[bot] Aug 28, 2024
3377138
[BI-2304] - added migrations for list position
mlm483 Sep 18, 2024
ea85b8c
[BI-2304] - fixed migration
mlm483 Sep 19, 2024
0c6952b
[BI-2304] - preserve list order without changing API
mlm483 Sep 20, 2024
06b8cac
[BI-2304] - used zero-indexing in migration
mlm483 Sep 20, 2024
76665ab
[BI-2304] - changes based on review
mlm483 Oct 2, 2024
86153e9
Merge pull request #37 from Breeding-Insight/feature/BI-2304
mlm483 Oct 7, 2024
8ec5466
Merge pull request #39 from Breeding-Insight/release/1.0
mlm483 Nov 8, 2024
e9e8acd
create batch entity and controller endpoints
dmeidlin Oct 21, 2024
492aabd
json deserialize searchrequest sub-types
dmeidlin Oct 22, 2024
46134a2
return batchDbID in POST batches response results
dmeidlin Oct 23, 2024
f2927aa
refactor
dmeidlin Oct 24, 2024
c33a8b6
add constraint to cascade on delete for list_item
dmeidlin Oct 25, 2024
b5f09ec
add soft_deleted column to list tables
dmeidlin Oct 26, 2024
a226dee
modify list repository to include clause softDelete=falsee
dmeidlin Oct 26, 2024
5f26eec
use where clause and transactional annotations
dmeidlin Oct 27, 2024
0aa634a
soft-delete batch lists
dmeidlin Oct 28, 2024
04dfa6c
add hard delete of single trial
dmeidlin Oct 28, 2024
fe1ae79
create hard-delete endpoint for single sample
dmeidlin Oct 29, 2024
f3283f4
cascade delete for trial and sample
dmeidlin Oct 29, 2024
aa7386e
add soft_delete columns to trial and sample related tables
dmeidlin Oct 29, 2024
008e033
create sample service soft-delete method
dmeidlin Oct 29, 2024
80838e1
add soft-delete method to trial service
dmeidlin Oct 29, 2024
6aab414
create Trial and Sample components
dmeidlin Oct 29, 2024
e94040c
optimize imports
dmeidlin Nov 5, 2024
5d915ba
respond with 204 for successful delete
dmeidlin Dec 3, 2024
1d4a768
return entity dbids in response for POST deleteBatch
dmeidlin Dec 3, 2024
a07aa4e
add batchDeleteDbId query param to GET endpoints for lists, trials, s…
dmeidlin Dec 3, 2024
8f33016
create new exception class for wrong batch delete type
dmeidlin Dec 3, 2024
f251236
delete batch entity when deleting batch contents
dmeidlin Dec 4, 2024
e1761f8
add cascade delete constraints for study foreign keys
dmeidlin Dec 9, 2024
b2a6ee3
rename batch to batch delete
dmeidlin Dec 13, 2024
dbe8cac
Merge pull request #38 from Breeding-Insight/hackathon/delete-germplasm
dmeidlin Dec 13, 2024
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
Prev Previous commit
Next Next commit
[BI-2304] - fixed migration
mlm483 committed Sep 19, 2024
commit ea85b8c5f2cc6609e0d0940424a13965ab2acbc0
98 changes: 50 additions & 48 deletions src/main/resources/db/migration/V002.001__update_list_positions.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

-- This migration updates existing list_item records based on DeltaBreed (Breeding Insight) specific fields.
--
-- These are the list types, since the BJTS uses Java enums, they are stored as int in the database.
-- These are the list types, the BJTS uses Java enums and stores ints in the database.
-- 0: germplasm
-- 1: markers
-- 2: programs
@@ -12,53 +12,55 @@
-- 7: observationVariables
-- 8: samples

DO
$$
BEGIN
-- Update germplasm list items, the goal is to use the order defined by the listEntryNumbers.
UPDATE
list_item
SET
position = subquery.position
FROM
(
SELECT
row_number() OVER (PARTITION BY li.list_id ORDER BY (g.additional_info->'listEntryNumbers'->>xr.external_reference_id)::int) AS position,
li.id AS list_item_id
FROM
list_item li
JOIN list l ON li.list_id = l.id
JOIN list_external_references ler ON l.id = ler.list_entity_id
JOIN external_reference xr ON xr.id = ler.external_references_id AND xr.external_reference_source = 'breedinginsight.org/lists'
JOIN germplasm g ON li.item = g.germplasm_name
WHERE
l.list_type = 0 -- 0 is germplasm
ORDER BY
l.id
) AS subquery
WHERE
list_item.id = subquery.list_item_id
;

-- Update germplasm list items, the goal is to use the order defined by the listEntryNumbers.
UPDATE
list_item
SET
position = subquery.position
FROM
(
SELECT
row_number() OVER (PARTITION BY li.list_id ORDER BY (g.additional_info->'listEntryNumbers'->>xr.external_reference_id)::int) AS position,
li.id AS list_item_id
FROM
list_item li
-- Update all non-germplasm list items. There is no existing order to preserve, assign sequential position values arbitrarily.
UPDATE
list_item
SET
position = subquery.position
FROM
(
SELECT
row_number() OVER (PARTITION BY li.list_id) AS position,
li.id AS list_item_id
FROM
list_item li
JOIN list l ON li.list_id = l.id
JOIN list_external_references ler ON l.id = ler.list_entity_id
JOIN external_reference xr ON xr.id = ler.external_references_id AND xr.external_reference_source = 'breedinginsight.org/lists'
JOIN germplasm g ON li.item = g.germplasm_name
WHERE
l.list_type = 0 -- 0 is germplasm
ORDER BY
l.id
) AS subquery
WHERE
list_item.id = subquery.list_item_id
;
WHERE
l.list_type != 0 -- 0 is germplasm, here we are addressing non-germplasm lists.
ORDER BY
l.id
) AS subquery
WHERE
list_item.id = subquery.list_item_id
;

-- Update all non-germplasm list items. There is no existing order to preserve, assign sequential position values arbitrarily.
UPDATE
list_item
SET
position = subquery.position
FROM
(
SELECT
row_number() OVER (PARTITION BY li.list_id) AS position,
li.id AS list_item_id
FROM
list_item li
JOIN list l ON li.list_id = l.id
JOIN list_external_references ler ON l.id = ler.list_entity_id
JOIN external_reference xr ON xr.id = ler.external_references_id AND xr.external_reference_source = 'breedinginsight.org/lists'
JOIN germplasm g ON li.item = g.germplasm_name
WHERE
l.list_type != 0 -- 0 is germplasm, here we are addressing non-germplasm lists.
ORDER BY
l.id
) AS subquery
WHERE
list_item.id = subquery.list_item_id
;
END;
$$;