-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue #1736] Adjust current opportunity summary logic to want null r…
…evision number (#1743) ## Summary Fixes #1736 ### Time to review: __3 mins__ ## Changes proposed Modify the set-current-opportunity script to determine the latest opportunity summary based on the revision number being null (rather than the max value) ## Context for reviewers My understanding of the revision number in the prior implementation was incorrect. We want to determine the latest revision of an opportunity summary based on the revision number, however the latest in the current Oracle system will always be null. The way the current system works is that the revision number is only added once it is moved to the history table. Because we effectively want to ignore all of the historical synopsis/forecast records, we can just check if the value is null. Due to how the data is structured in the current system where the values are unique in the synopsis & forecast tables for a given opportunity, we know there will only ever be a single forecast / non-forecast that has this value set to null in the data.
- Loading branch information
Showing
4 changed files
with
50 additions
and
18 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
api/src/db/migrations/versions/2024_04_16_make_revision_number_nullable.py
This file contains 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,39 @@ | ||
"""make revision number nullable | ||
Revision ID: b26ea0f40066 | ||
Revises: f8364285630d | ||
Create Date: 2024-04-16 13:36:35.993325 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "b26ea0f40066" | ||
down_revision = "f8364285630d" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"opportunity_summary", | ||
"revision_number", | ||
existing_type=sa.INTEGER(), | ||
nullable=True, | ||
schema="api", | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"opportunity_summary", | ||
"revision_number", | ||
existing_type=sa.INTEGER(), | ||
nullable=False, | ||
schema="api", | ||
) | ||
# ### end Alembic commands ### |
This file contains 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 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 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