Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Crossley <[email protected]>
  • Loading branch information
chirino and jcrossley3 committed Jan 22, 2025
1 parent ca799fa commit f54d171
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions migration/src/m0000840_add_relationship_14_15.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ use sea_orm_migration::prelude::*;

#[derive(DeriveMigrationName)]
pub struct Migration;

const DATA: [(i32, &str); 2] = [(14, "DescribedBy"), (15, "PackageOf")];
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let data = [(14, "DescribedBy"), (15, "PackageOf")];

for (id, description) in data {
for (id, description) in DATA {
let insert = Query::insert()
.into_table(Relationship::Table)
.columns([Relationship::Id, Relationship::Description])
Expand All @@ -22,9 +20,7 @@ impl MigrationTrait for Migration {
}

async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
let data = [(14, "DescribedBy"), (15, "PackageOf")];

for (id, _) in data {
for (id, _) in DATA {
let insert = Query::delete()
.from_table(Relationship::Table)
.and_where(Expr::col(Relationship::Id).lt(id))
Expand Down
2 changes: 1 addition & 1 deletion modules/analysis/src/endpoints/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ async fn cdx_ancestor_of(ctx: &TrustifyContext) -> Result<(), anyhow::Error> {

#[test_context(TrustifyContext)]
#[test(actix_web::test)]
async fn issue_spdx_package_of(ctx: &TrustifyContext) -> Result<(), anyhow::Error> {
async fn spdx_package_of(ctx: &TrustifyContext) -> Result<(), anyhow::Error> {
// test case for the simple case of "relationshipType": "PACKAGE_OF" spdx relationships:
// https://github.com/trustification/trustify/issues/1140

Expand Down

0 comments on commit f54d171

Please sign in to comment.