feat: added repo mirrors migration
This commit is contained in:
parent
f761e3b36d
commit
cbb04a40e0
9 changed files with 135 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue