Better database layout with uuid primary keys

Serialize and deserialize the uuid ids as base62 strings in the URLs.
This commit is contained in:
2023-06-27 14:03:52 -04:00
parent 4e41bbd6e1
commit abd540d2ff
17 changed files with 290 additions and 121 deletions

View File

@@ -3,6 +3,7 @@ use axum::response::{IntoResponse, Response};
use axum::Json;
use tracing::error;
use serde_with::DisplayFromStr;
use uuid::Uuid;
use validator::ValidationErrors;
/// An API-friendly error type.
@@ -23,7 +24,7 @@ pub enum Error {
InvalidEntity(#[from] ValidationErrors),
#[error("{0}: {1} not found")]
NotFound(&'static str, i32),
NotFound(&'static str, Uuid),
#[error("referenced {0} not found")]
RelationNotFound(&'static str),