-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue #2493] Allow certain agency fields to be null from the legacy …
…values (#2513) ## Summary Fixes #2493 ### Time to review: __5 mins__ ## Changes proposed Modified three fields (ldapGp, description, label) in the agency table to be nullable Adjusted the transform agency process to allow these fields to be nullable as well ## Context for reviewers This isn't an issue in prod right now, but is accounting for a problem I found in the dev/staging environments. The agency data is stored in a very different way (key-value pairs) in the legacy data, and these fields are sometimes not present in the test data. There isn't any reason we should require them as we likely won't use them, so I'm letting them be nullable to let these agencies with the values null get populated in the lower envs. ## Additional information There is some additional context on #2494 --------- Co-authored-by: nava-platform-bot <[email protected]>
- Loading branch information
1 parent
1277e32
commit ca4e177
Showing
8 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
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
32 changes: 32 additions & 0 deletions
32
api/src/db/migrations/versions/2024_10_17_legacy_null_agency.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,32 @@ | ||
"""legacy null agency | ||
Revision ID: 558ad9563e9a | ||
Revises: 56448a3ecb8f | ||
Create Date: 2024-10-17 13:54:32.420425 | ||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "558ad9563e9a" | ||
down_revision = "56448a3ecb8f" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column("agency", "ldap_group", existing_type=sa.TEXT(), nullable=True, schema="api") | ||
op.alter_column("agency", "description", existing_type=sa.TEXT(), nullable=True, schema="api") | ||
op.alter_column("agency", "label", existing_type=sa.TEXT(), nullable=True, schema="api") | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column("agency", "label", existing_type=sa.TEXT(), nullable=False, schema="api") | ||
op.alter_column("agency", "description", existing_type=sa.TEXT(), nullable=False, schema="api") | ||
op.alter_column("agency", "ldap_group", existing_type=sa.TEXT(), 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.