Skip to content

Commit

Permalink
chore: change name of the field
Browse files Browse the repository at this point in the history
Co-authored-by: Jim Crossley <[email protected]>
  • Loading branch information
ctron and jcrossley3 committed Dec 6, 2024
1 parent c1df119 commit 4054521
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion entity/src/source_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct Model {
pub sha384: String,
pub sha512: String,
pub size: i64,
pub ingestion_time: time::OffsetDateTime,
pub ingested: time::OffsetDateTime,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
Expand Down
6 changes: 3 additions & 3 deletions migration/src/m0000780_alter_source_document_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl MigrationTrait for Migration {
Table::alter()
.table(SourceDocument::Table)
.add_column(
ColumnDef::new(SourceDocument::IngestionTime)
ColumnDef::new(SourceDocument::Ingested)
.timestamp_with_time_zone()
.default(Func::cust(Now))
.not_null()
Expand All @@ -30,7 +30,7 @@ impl MigrationTrait for Migration {
.alter_table(
Table::alter()
.table(SourceDocument::Table)
.drop_column(SourceDocument::IngestionTime)
.drop_column(SourceDocument::Ingested)
.to_owned(),
)
.await?;
Expand All @@ -42,5 +42,5 @@ impl MigrationTrait for Migration {
#[derive(DeriveIden)]
enum SourceDocument {
Table,
IngestionTime,
Ingested,
}
4 changes: 2 additions & 2 deletions modules/fundamental/src/source_document/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct SourceDocument {
pub size: u64,
/// The timestamp the document was ingested
#[serde(with = "time::serde::rfc3339")]
pub ingestion_time: OffsetDateTime,
pub ingested: OffsetDateTime,
}

impl SourceDocument {
Expand All @@ -25,7 +25,7 @@ impl SourceDocument {
sha384: format!("sha384:{}", source_document.sha384),
sha512: format!("sha512:{}", source_document.sha512),
size: source_document.size as u64,
ingestion_time: source_document.ingestion_time,
ingested: source_document.ingested,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/ingestor/src/graph/advisory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl Graph {
sha384: Set(digests.sha384.encode_hex()),
sha512: Set(digests.sha512.encode_hex()),
size: Set(digests.size as i64),
ingestion_time: sea_orm::Set(OffsetDateTime::now_utc()),
ingested: sea_orm::Set(OffsetDateTime::now_utc()),
};

let doc = doc_model.insert(connection).await?;
Expand Down
2 changes: 1 addition & 1 deletion modules/ingestor/src/graph/sbom/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl Graph {
sha384: Set(digests.sha384.encode_hex()),
sha512: Set(digests.sha512.encode_hex()),
size: Set(digests.size as i64),
ingestion_time: Set(OffsetDateTime::now_utc()),
ingested: Set(OffsetDateTime::now_utc()),
};

let doc = doc_model.insert(connection).await?;
Expand Down

0 comments on commit 4054521

Please sign in to comment.