-
Notifications
You must be signed in to change notification settings - Fork 649
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
Conversation
id SERIAL PRIMARY KEY, | ||
version_id INTEGER, | ||
owner_id INTEGER, | ||
owner_token_id INTEGER, |
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'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.
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.
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,
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.
@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`.
☔ The latest upstream changes (presumably #1699) made this pull request unmergeable. Please resolve the merge conflicts. |
I've used your changes, made some improvements and moved things a little further forward. I'd love your feedback. It is PR #1700. |
The ltree `use` statements aren't in the schema anymore.
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.
Thank you! Again, I'm sorry about the long delay!
@bors r+ |
📌 Commit e5c6242 has been approved by |
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)
☀️ Test successful - checks-travis |
Add a migration to create the
version_owner_actions
table, as well as aVersionOwnerAction
struct inmodels/actions.rs
.Ref. #1548 (Task 2)