Skip to content

Always bump the updated_at on uploads #925

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

Closed
wants to merge 1 commit into from

Conversation

notriddle
Copy link
Contributor

Fixes #908

@vignesh-sankaran
Copy link
Contributor

Could you run cargo fmt and push the code up again please? :)

@sgrif
Copy link
Contributor

sgrif commented Aug 1, 2017

This is the wrong solution. We should never be managing updated_at in the application. It looks like the issue here is that we are missing a trigger on versions to set updated_at on the crate, which is the reason it should be getting bumped.

@notriddle
Copy link
Contributor Author

This pull request was obsoleted by #931

@notriddle notriddle closed this Aug 1, 2017
bors-voyager bot added a commit that referenced this pull request Aug 20, 2017
931: Touch a crate whenever its versions are changed r=carols10cents

Prior to this commit, if uploading a new version of a crate didn't
otherwise change the metadata (description, etc), the crate's updated_at
record wouldn't be changed.

The migration specifically checks if `updated_at` changed on the
versions to make sure the touch doesn't happen if `downloads` was
bumped. I wanted to avoid duplicating that here, so instead this will
only happen if the row is new, or as a result of the trigger bumping
updated_at on the version.

I have specifically not included a query to correct existing data, as
it's an irreversable operation. We should manually run a query like
`UPDATE crates SET updated_at = MAX(crates.updated_at,
SELECT(MAX(versions.updated_at) FROM versions WHERE versions.crate_id =
crates.id))` if we want to correct existing data.

Fixes #908.
Close #925.

936: Add more documentation r=carols10cents

As part of the effort to better document crates.io, I added more documentation comments to the `krate::index` and `krate::new` functions as well as to some associated functions. Also added some comments in some functions and to document. Thanks for providing the background on these functions @carols10cents :).

I'd like to doc comment the git::yank function as well before this gets merged.

969: crate.scss: When rendering code in README, don't show scrollbar unless necessary r=carols10cents

The current `overflow-x: scroll` shows a scrollbar all the time, even
for code blocks that don't need them. Switch to `overflow-x: auto`, to
only show the scrollbar when needed.

979: CSS: Restrict readme image width r=carols10cents

Fixes #971
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.

3 participants