Initial work on new status sys + scheduling releases (#489)

* Initial work on new status sys + scheduling releases

* Finish project statuses + begin work on version statuses

* Finish version statuses

* Regenerate prepare

* Run fmt + clippy
This commit is contained in:
Geometrically
2022-12-06 08:14:52 -08:00
committed by GitHub
parent c34e2ab3e1
commit e96d23cc3f
26 changed files with 2456 additions and 1906 deletions

View File

@@ -18,9 +18,7 @@ pub use project_item::Project;
pub use team_item::Team;
pub use team_item::TeamMember;
pub use user_item::User;
pub use version_item::FileHash;
pub use version_item::Version;
pub use version_item::VersionFile;
#[derive(Error, Debug)]
pub enum DatabaseError {
@@ -32,28 +30,6 @@ pub enum DatabaseError {
Other(String),
}
impl ids::StatusId {
pub async fn get_id<'a, E>(
status: &crate::models::projects::ProjectStatus,
exec: E,
) -> Result<Option<Self>, DatabaseError>
where
E: sqlx::Executor<'a, Database = sqlx::Postgres>,
{
let result = sqlx::query!(
"
SELECT id FROM statuses
WHERE status = $1
",
status.as_str()
)
.fetch_optional(exec)
.await?;
Ok(result.map(|r| ids::StatusId(r.id)))
}
}
impl ids::SideTypeId {
pub async fn get_id<'a, E>(
side: &crate::models::projects::SideType,