refactor: remove unused fields from PostgresMedia and update related queries
This commit is contained in:
@@ -52,10 +52,6 @@ pub struct PostgresMedia {
|
|||||||
pub mime_type: String,
|
pub mime_type: String,
|
||||||
pub hash: String,
|
pub hash: String,
|
||||||
pub created_at: chrono::DateTime<chrono::Utc>,
|
pub created_at: chrono::DateTime<chrono::Utc>,
|
||||||
pub extracted_location: Option<String>,
|
|
||||||
pub width: Option<i32>,
|
|
||||||
pub height: Option<i32>,
|
|
||||||
pub date_taken: Option<chrono::DateTime<chrono::Utc>>,
|
|
||||||
pub thumbnail_path: Option<String>,
|
pub thumbnail_path: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ impl MediaRepository for PostgresMediaRepository {
|
|||||||
PostgresMedia,
|
PostgresMedia,
|
||||||
r#"
|
r#"
|
||||||
SELECT id, owner_id, storage_path, original_filename, mime_type, hash, created_at,
|
SELECT id, owner_id, storage_path, original_filename, mime_type, hash, created_at,
|
||||||
extracted_location, width, height, date_taken, thumbnail_path
|
thumbnail_path
|
||||||
FROM media
|
FROM media
|
||||||
WHERE hash = $1
|
WHERE hash = $1
|
||||||
"#,
|
"#,
|
||||||
@@ -73,7 +73,7 @@ impl MediaRepository for PostgresMediaRepository {
|
|||||||
PostgresMedia,
|
PostgresMedia,
|
||||||
r#"
|
r#"
|
||||||
SELECT id, owner_id, storage_path, original_filename, mime_type, hash, created_at,
|
SELECT id, owner_id, storage_path, original_filename, mime_type, hash, created_at,
|
||||||
extracted_location, width, height, date_taken, thumbnail_path
|
thumbnail_path
|
||||||
FROM media
|
FROM media
|
||||||
WHERE id = $1
|
WHERE id = $1
|
||||||
"#,
|
"#,
|
||||||
@@ -90,7 +90,7 @@ impl MediaRepository for PostgresMediaRepository {
|
|||||||
let mut query = sqlx::QueryBuilder::new(
|
let mut query = sqlx::QueryBuilder::new(
|
||||||
r#"
|
r#"
|
||||||
SELECT id, owner_id, storage_path, original_filename, mime_type, hash, created_at,
|
SELECT id, owner_id, storage_path, original_filename, mime_type, hash, created_at,
|
||||||
extracted_location, width, height, date_taken, thumbnail_path
|
thumbnail_path
|
||||||
FROM media
|
FROM media
|
||||||
WHERE owner_id =
|
WHERE owner_id =
|
||||||
"#,
|
"#,
|
||||||
|
|||||||
Reference in New Issue
Block a user