Skip to content

Add migration and model for version_owner_actions table #1604

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 4 commits into from
Oct 6, 2019
Merged

Add migration and model for version_owner_actions table #1604

merged 4 commits into from
Oct 6, 2019

Conversation

joshleeb
Copy link

Add a migration to create the version_owner_actions table, as well as a VersionOwnerAction struct in models/actions.rs.

Ref. #1548 (Task 2)

id SERIAL PRIMARY KEY,
version_id INTEGER,
owner_id INTEGER,
owner_token_id INTEGER,
Copy link
Author

Choose a reason for hiding this comment

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

I've left REFERENCES api_token(id) and similar off from up.sql as it was causing an error with applying schema.patch to schema.rs.

Wasn't sure if that is something that is expected (and the foreign keys are defined in the model) of if there was something I was doing wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nothing you're doing wrong. I'm surprised patch wasn't able to resolve this on its own. We probably need to pass it some more flags... This change will allow the patch to apply with your new foreign key.

diff --git a/src/schema.patch b/src/schema.patch
index 3ccdaee..7331e23 100644
--- a/src/schema.patch
+++ b/src/schema.patch
@@ -66,7 +66,7 @@ index df884e4..18e08cd 100644
  joinable!(version_authors -> users (user_id));
  joinable!(version_authors -> versions (version_id));
  joinable!(version_downloads -> versions (version_id));
- joinable!(versions -> crates (crate_id));
+ joinable!(version_owner_actions -> api_tokens (owner_token_id));
  
 @@ -913,12 +935,13 @@ allow_tables_to_appear_in_same_query!(
      dependencies,

Copy link
Author

Choose a reason for hiding this comment

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

@sgrif seemed to do the trick, thanks!

Add a migration to create the `version_owner_actions` table, as well as
a `VersionOwnerAction` struct in `models/actions.rs`.
@bors
Copy link
Contributor

bors commented Mar 28, 2019

☔ The latest upstream changes (presumably #1699) made this pull request unmergeable. Please resolve the merge conflicts.

@markcatley
Copy link
Contributor

I've used your changes, made some improvements and moved things a little further forward. I'd love your feedback. It is PR #1700.

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.

Thank you! Again, I'm sorry about the long delay!

@carols10cents
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 6, 2019

📌 Commit e5c6242 has been approved by carols10cents

@bors
Copy link
Contributor

bors commented Oct 6, 2019

⌛ Testing commit e5c6242 with merge ccfda71...

bors added a commit that referenced this pull request Oct 6, 2019
Add migration and model for version_owner_actions table

Add a migration to create the `version_owner_actions` table, as well as a `VersionOwnerAction` struct in `models/actions.rs`.

Ref. #1548 (Task 2)
@bors
Copy link
Contributor

bors commented Oct 6, 2019

☀️ Test successful - checks-travis
Approved by: carols10cents
Pushing ccfda71 to master...

@bors bors merged commit e5c6242 into rust-lang:master Oct 6, 2019
bors added a commit that referenced this pull request Dec 2, 2019
Add audit trail to the publish, yank and unyank transactions.

Contributes to [Issue 1548](#1548)
Based on the commits from [PR 1604](#1604)
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.

5 participants