feat: added repo mirrors migration
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint Pipeline failed

This commit is contained in:
Jef Roosens 2024-07-18 22:40:31 +02:00
parent f761e3b36d
commit cbb04a40e0
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
9 changed files with 135 additions and 1 deletions

View file

@ -52,12 +52,14 @@ pub async fn insert(
distro_id: i32,
name: &str,
description: Option<&str>,
r#type: entity::RepoType,
) -> Result<repo::Model> {
let model = repo::ActiveModel {
id: NotSet,
distro_id: Set(distro_id),
name: Set(String::from(name)),
description: Set(description.map(String::from)),
r#type: Set(r#type),
};
model.insert(conn).await

View file

@ -70,6 +70,7 @@ impl Handle {
distro_id: Set(distro_id),
name: Set(repo.to_string()),
description: NotSet,
r#type: Set(entity::RepoType::Regular),
};
let id = new_repo.insert(&self.state.conn).await?.id;