-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update migrations to follow team convention #330
Merged
Merged
Conversation
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
As a team we have agreed that [our convention](https://github.com/DEFRA/water-abstraction-team/blob/main/coding_conventions.md#arrow-functions) when using arrow functions is to always wrap arguments in brackets even if there is only 1. We spotted with a recent migration that we were not doing this. As we tend to copy and paste previous migrations when adding new ones we've decided to correct what we have to save repeating the infraction in future changes!
Cruikshanks
added
the
housekeeping
Refactoring, tidying up or other work which supports the project
label
Aug 2, 2023
Jozzey
previously approved these changes
Aug 2, 2023
StuAA78
reviewed
Aug 2, 2023
Note! Not all instances could be updated. There are times we are performing multiple calls in a migration therefore we do need to use async and await. Also spotted some export.downs that were async but returning knex.schema() 🤦. Fixed those as well 😁
StuAA78
reviewed
Aug 3, 2023
Jozzey
approved these changes
Aug 3, 2023
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.
👍🏼
StuAA78
approved these changes
Aug 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As a team, we have agreed that our convention when using arrow functions is to always wrap arguments in brackets even if there are only 1.
We spotted with a recent migration that we were not doing this. At the same time, we also clocked we were doing the following in some migrations.
The Knex example implies what we are doing in
down()
is correct. Looking at some of our more straightforward migrations, for example, when creating schemas we saw that's what we were already doing.As we tend to copy and paste previous migrations when adding new ones we've decided to correct what we have to save repeating the infractions in future changes!