Move tags to their own module
All checks were successful
Core Repos/ImageApi/pipeline/pr-master This commit looks good

This commit is contained in:
Cameron Cordes
2022-03-17 22:07:33 -04:00
parent c8cae28c9f
commit 40c79d13db
3 changed files with 185 additions and 174 deletions

View File

@@ -1,4 +1,4 @@
use crate::database::schema::{favorites, tagged_photo, tags, users};
use crate::database::schema::{favorites, users};
use serde::Serialize;
#[derive(Insertable)]
@@ -29,33 +29,3 @@ pub struct Favorite {
pub userid: i32,
pub path: String,
}
#[derive(Serialize, Queryable, Clone, Debug)]
pub struct Tag {
pub id: i32,
pub name: String,
pub created_time: i64,
}
#[derive(Insertable, Clone, Debug)]
#[table_name = "tags"]
pub struct InsertTag {
pub name: String,
pub created_time: i64,
}
#[derive(Insertable, Clone, Debug)]
#[table_name = "tagged_photo"]
pub struct InsertTaggedPhoto {
pub tag_id: i32,
pub photo_name: String,
pub created_time: i64,
}
#[derive(Queryable, Clone, Debug)]
pub struct TaggedPhoto {
pub id: i32,
pub photo_name: String,
pub tag_id: i32,
pub created_time: i64,
}