-
Notifications
You must be signed in to change notification settings - Fork 1
Bug/bi 1594 #216
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
Merged
Merged
Bug/bi 1594 #216
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6bb5250
[Bi-1594] TrialId was being gernerated and saved inconsistently
davedrp 195598d
[BI-1594] fix bug in the experiment sequence (and observation unit se…
davedrp ed57611
[BI-1594] append environment sequence number to Exp Unit ID
davedrp 203082c
[BI-1594] defensive code
davedrp c864418
[BI-1594] Removed obs_unit_squences
davedrp 28fd752
[BI-1594] updated migrations with the 'IF NOT EXISTS' parameter
davedrp ee8f5c8
[BI-154] fixed bug - could not save a new study with a new location (…
davedrp f4b8b28
[BI-1594] restore V1.0.3__create_obs_unit_sequence.sql
davedrp b017a5d
[BI-1594] Only add the envSequenceValue to the study if commiting. I…
davedrp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/resources/db/migration/V1.0.6__create_environment_sequence.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * See the NOTICE file distributed with this work for additional information | ||
| * regarding copyright ownership. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| alter table program add column IF NOT EXISTS env_sequence text; | ||
|
|
||
| do | ||
| $$ | ||
| declare | ||
| f record; | ||
| begin | ||
| for f in select * from program | ||
| loop | ||
| if f.key is NULL then | ||
| RAISE EXCEPTION 'Programs must have a key associated with them'; | ||
| end if; | ||
| execute format('create sequence IF NOT EXISTS %s_env_sequence',f.key); | ||
| update program set env_sequence = format('%s_env_sequence', f.key) where id = f.id; | ||
| end loop; | ||
| end; | ||
| $$ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a suggestion for this card, but it may be worth having a card to refactor this logic to create a location via the
ProgramLocationService, that way the location gets created in both the backing BrAPI server and in the BI DB