-
Notifications
You must be signed in to change notification settings - Fork 123
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
Drop and re-create genesis_info_view #689
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.
I think we should add a word or two in the commit body to explain why this change is necessary.
e1d6895
to
fbf356e
Compare
The above seems to fail the
Is the approach correct? Seems like dropping the view before re-creating it invalidates other stuff |
From offline discussion: The |
2c151be
to
ccc5309
Compare
Ok, I reproduced the original error from #685 with approx. these steps:
Restarting tapd 2 after building this branch worked and resolved the issue, but from manual inspection the DB seems to be in a weird state. The Not sure if |
Isn't the |
Double-checked, I think the only migration missing a @ffranr thoughts? |
83494cd
to
719687f
Compare
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.
I don't think we should worry about rolling back migrations. I think it's ok to leave the .down.sql
file empty.
Is it possible to add an itest that would break without this new view? I can't see why our itests didn't catch this to begin with.
@@ -315,7 +315,7 @@ CREATE TABLE IF NOT EXISTS asset_seedlings ( | |||
CREATE VIEW genesis_info_view AS | |||
SELECT | |||
gen_asset_id, asset_id, asset_tag, assets_meta.meta_data_hash meta_hash, | |||
output_index, asset_type, genesis_points.prev_out prev_out, | |||
output_index, asset_type, genesis_points.prev_out prev_out, |
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.
I don't think we should modify an old migration file. Might make it more complicated to debug later.
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.
This PR only has a trailing space as diff. Are you suggesting we revert the contents of this migration to the ones present prior to #667 ? (remove anchor_txid
from this PR?)
This change patches a previous commit which erroneously editted the 000002 migration to include an extra field in a created view. We now make a new migration which drops the old view and creates a new one in its place with the extra field present.
719687f
to
ddff1af
Compare
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 🚀
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.
Looks good to me! 👍
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.
Post merge ACK.
Closes #685