Labrinth ID cleanup (#3681)

* Put all ID types in the labrinth::models::ids, and reduce code duplication with them

* Rewrite labrinth::database::models::ids and rename most DB interface ID structs to be prefixed with DB

* Run sqlx prepare

---------

Co-authored-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>
This commit is contained in:
Josiah Glosson
2025-05-22 03:34:36 -05:00
committed by GitHub
parent c6022ad977
commit 9e527ff141
111 changed files with 1477 additions and 1965 deletions

View File

@@ -73,10 +73,8 @@ pub fn validate_deps(
.duplicates_by(|x| {
format!(
"{}-{}-{}",
x.version_id
.unwrap_or(crate::models::projects::VersionId(0)),
x.project_id
.unwrap_or(crate::models::projects::ProjectId(0)),
x.version_id.unwrap_or(crate::models::ids::VersionId(0)),
x.project_id.unwrap_or(crate::models::ids::ProjectId(0)),
x.file_name.as_deref().unwrap_or_default()
)
})

View File

@@ -1,6 +1,6 @@
use crate::database::models::legacy_loader_fields::MinecraftGameVersion;
use crate::database::redis::RedisPool;
use crate::models::projects::ProjectId;
use crate::models::ids::ProjectId;
use crate::routes::ApiError;
use ariadne::ids::base62_impl::to_base62;
use chrono::{DateTime, Utc};