diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-01-11 10:24:57 +0100 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-01-14 13:29:41 +0100 |
commit | 4a92855656e30ca4d22531eb41f263afa607d1f3 (patch) | |
tree | 0026f74ce95b29449dfdfc622fc7004a1138ffc4 /src/db | |
parent | 7c40da3f5e15d52183500e1b48aab79415ecea7a (diff) |
Fix: Submit is associated with Package and Image
Make sure the inner_join() in the "submits" command implementation joins on the
jobs table, not on the packages table.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/models/submit.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/db/models/submit.rs b/src/db/models/submit.rs index e6bc8af..63f72b1 100644 --- a/src/db/models/submit.rs +++ b/src/db/models/submit.rs @@ -22,7 +22,10 @@ use crate::db::models::Package; use crate::schema::submits::*; use crate::schema::submits; -#[derive(Clone, Debug, Identifiable, Queryable)] +#[derive(Clone, Debug, Identifiable, Queryable, Associations)] +#[belongs_to(Package, foreign_key = "requested_package_id")] +#[belongs_to(Image, foreign_key = "requested_image_id")] +#[table_name="submits"] pub struct Submit { pub id: i32, pub uuid: ::uuid::Uuid, |