Skip to content

Move readme_rendered_at off of the versions table #1238

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

Merged
merged 3 commits into from
Feb 3, 2018

Conversation

sgrif
Copy link
Contributor

@sgrif sgrif commented Jan 18, 2018

This column is never used in code other than for filtering/recording
purposes. We do not put it on the Version struct, and don't need to be
sending it over the wire every time we query that table.

This column is never used in code other than for filtering/recording
purposes. We do not put it on the `Version` struct, and don't need to be
sending it over the wire every time we query that table.
@carols10cents
Copy link
Member

Uuuhhhh but you did the opposite to this? 9c6412f#diff-2d162e07be0cf65cc1054b2128c60258

@sgrif
Copy link
Contributor Author

sgrif commented Jan 25, 2018

Am I not allowed to change my mind? :(

The main thing I think I was opposed to was the amount of code that existed for no apparent reason, more than the schema itself. Also the schema makes much more sense to me when it's clear that exactly one row exists, and that the timestamp is always present in that case

The main motivation here is to be able to remove the last manual Queryable impl

@carols10cents
Copy link
Member

I just want to be sure you're not going to be changing your mind back and forth forever :(

@sgrif
Copy link
Contributor Author

sgrif commented Jan 25, 2018

Well I can at least say that moving this back again will require bringing back the manual Queryable impl (which I want to kill), so that's a decent motivation for leaving it in this state.

Copy link
Member

@carols10cents carols10cents left a comment

Choose a reason for hiding this comment

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

q about upsert


diesel::update(self)
.set(readme_rendered_at.eq(now.nullable()))
diesel::insert_into(readme_renderings)
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this need to be an upsert? Or does insert_into handle upserts automatically? Occasionally, when we change the readme rendering, I rerender all the readmes, which should update this timestamp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch

@carols10cents
Copy link
Member

I added a test to encode the historical/contextual knowledge I had, it is indeed failing on this branch :)

From Carol:

> Occasionally, when we change the readme rendering, I rerender all the readmes, which should update this timestamp.
@sgrif
Copy link
Contributor Author

sgrif commented Feb 3, 2018

bors: r+

(I'm assuming you're good with this after I fixed that issue)

bors-voyager bot added a commit that referenced this pull request Feb 3, 2018
1238: Move `readme_rendered_at` off of the versions table r=sgrif

This column is never used in code other than for filtering/recording
purposes. We do not put it on the `Version` struct, and don't need to be
sending it over the wire every time we query that table.
@bors-voyager
Copy link
Contributor

bors-voyager bot commented Feb 3, 2018

Build succeeded

@bors-voyager bors-voyager bot merged commit 39feeb6 into rust-lang:master Feb 3, 2018
@sgrif sgrif deleted the sg-separate-readme-renderings branch February 3, 2018 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants