-
Notifications
You must be signed in to change notification settings - Fork 38
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 isFile
column in url table
#53
Conversation
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.
Thought through the use of DEFAULT false, still have to
- backfill false values for standard short links
- backfill url_history
@liangyuanruo I've changed the approach back to the one you were suggesting, involving two steps. The first being to set a nullable column in both tables, and then the second script to backfill + add not-null constraint. |
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.
As commented
d2496bb
to
e59da8c
Compare
647ee24
to
86b4565
Compare
86b4565
to
b93c22e
Compare
target branch has been changed to |
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.
lgtm!
Problem
We need to introduce a column in the url table to indicate whether a shortlink is pointing to a file.go.gov.sg object.
Solution
Create two scripts. The first would be to add the isFile column in a backwards-compatible way. This is done by making the column nullable(already true by default). After future PRs that update the codebase to start writing into the isFile column, run the second script to backfill and set the not-null constraint.
Follow up
I'll PR the next step which updates the url model after the migration strategy has been finalised and merged.