Update migrations - add contributors url#18
Open
VishakhaSainani-Josh wants to merge 3 commits intomainfrom
Open
Update migrations - add contributors url#18VishakhaSainani-Josh wants to merge 3 commits intomainfrom
VishakhaSainani-Josh wants to merge 3 commits intomainfrom
Conversation
Comment on lines
1
to
5
| ALTER TABLE repositories ADD COLUMN contributors_url VARCHAR(255); | ||
|
|
||
| UPDATE repositories SET contributors_url = '' WHERE contributors_url IS NULL; | ||
|
|
||
| ALTER TABLE repositories ALTER COLUMN contributors_url SET NOT NULL; |
Collaborator
There was a problem hiding this comment.
Could we do as below?
ALTER TABLE repositories ADD COLUMN contributors_url VARCHAR(255) DEFAULT '';
Also I would be good to have only 1 alter table per migration.
Collaborator
Author
There was a problem hiding this comment.
Even though both are related and it is just setting the added column as null. So for that also I should do separate migrations?
Collaborator
There was a problem hiding this comment.
yes, we should ideally keep 1 statement per migration file. So that migration roll back can easily be done in case of errors.
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
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.
Update migrations- need to add contributors_url in repository table to use the url later for fetching contributors.