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

Add defaults to unused column crm.document_header #1006

Merged
merged 2 commits into from Jan 8, 2024

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-4292

As part of making the migrations work in water-abstraction-system we have been creating DB Views of the legacy crm data that better represent the data as we use it in our new service. Part of this exercise is pruning out the unused columns that exist in the legacy tables that are not utilised.

However, we have found that some of the columns in the legacy data, whilst pointless, still need to be populated as they are set to Not Nullable in the legacy database tables. Therefore, we will set a default value for these columns in the legacy DB so that they are always populated even when they do not exist in our new Views.

The table columns that will be affected by this PR are:

  • crm.document_header.system_id - this is always "permit-repo" so it will default to "permit-repo"

https://eaflood.atlassian.net/browse/WATER-4292

As part of making the migrations work in `water-abstraction-system` we have been creating DB Views of the legacy crm data that better represent the data as we use it in our new service. Part of this exercise is pruning out the unused columns that exist in the legacy tables that are not utilised.

However, we have found that for some of the columns in the legacy data, whilst pointless, still need to be populated as they are set to `Not Nullable` in the legacy database tables. Therefore, we will set a default value for these columns in the legacy DB so that they are always populated even when they do not exist in our new Views.

The table columns that will be affected by this PR are:

- `crm.document_header.system_id` - this is always "permit-repo" so it will default to "permit-repo"
@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label Jan 8, 2024
@Cruikshanks Cruikshanks self-assigned this Jan 8, 2024
@Cruikshanks Cruikshanks marked this pull request as ready for review January 8, 2024 00:31
Copy link
Contributor

@Jozzey Jozzey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@Cruikshanks Cruikshanks merged commit ec5053a into main Jan 8, 2024
4 checks passed
@Cruikshanks Cruikshanks deleted the add-defaults-to-unused-columns branch January 8, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
3 participants