album/crates/album-db/schema.rs
Andrey Tkachenko 7f189b49b2
All checks were successful
continuous-integration/drone/push Build is passing
Api v1
2023-07-10 17:52:30 +04:00

156 lines
2.9 KiB
Rust

table! {
cameras (id) {
id -> Int4,
owner_id -> Int4,
vendor -> Varchar,
model -> Varchar,
lens -> Nullable<Varchar>,
created_at -> Timestamp,
}
}
table! {
persons (id) {
id -> Int4,
slug -> Varchar,
first_name -> Varchar,
last_name -> Nullable<Varchar>,
created_at -> Timestamp,
}
}
table! {
person_attributes (id) {
id -> Int4,
kind -> Int2,
embeddings -> Nullable<Array<Array<f32>>>,
}
}
table! {
objects (id) {
id -> Int4,
kind -> Int2,
title -> String,
}
}
table! {
asset_objects (asset_id, object_id) {
asset_id -> Int4,
object_id -> Int4,
bbox -> Nullable<Rect<Int2>>,
}
}
table! {
asset_persons (photo_id, person_id) {
photo_id -> Int4,
person_id -> Int4,
bbox -> Nullable<Rect<Int2>>,
points -> Nullable<Array<Point>>,
}
}
table! {
asset_places (asset_id, place_id) {
asset_id -> Int4,
place_id -> Int4,
}
}
table! {
asset_tags (asset_id, tag_id) {
asset_id -> Int4,
tag_id -> Int4,
}
}
table! {
assets (id) {
id -> Int4,
path -> Varchar,
date -> Nullable<Timestamp>,
grade -> Nullable<Int2>,
rotation -> Int2,
is_public -> Bool,
camera_id -> Nullable<Int4>,
attribution_id -> Nullable<Int4>,
width -> Int4,
height -> Int4,
}
}
table! {
asset_infos! {
}
}
table! {
places (id) {
id -> Int4,
slug -> Varchar,
title -> Varchar,
lat -> Float,
lng -> Float
osm_id -> Nullable<Int8>,
osm_level -> Nullable<Int2>,
}
}
table! {
tags (id) {
id -> Int4,
slug -> Varchar,
name -> Varchar,
group -> Nullable<Varchar>,
}
}
table! {
users (id) {
id -> Int4,
email -> Varchar,
password -> Varchar,
first_name -> Varchar,
last_name -> Nullable<Varchar>,
created_at -> Timestamp,
}
}
table! {
user_sessions (id) {
id -> Varchar,
user_id -> Int4,
user_agent -> Varchar,
location -> Option<Varchar>,
last_access_at -> Timestamp,
created_at -> Timestamp,
}
}
joinable!(photo_people -> people (person_id));
joinable!(photo_people -> photos (photo_id));
joinable!(photo_places -> photos (photo_id));
joinable!(photo_places -> places (place_id));
joinable!(photo_tags -> photos (photo_id));
joinable!(photo_tags -> tags (tag_id));
joinable!(photos -> attributions (attribution_id));
joinable!(photos -> cameras (camera_id));
joinable!(positions -> photos (photo_id));
allow_tables_to_appear_in_same_query!(
attributions,
cameras,
people,
photo_people,
photo_places,
photo_tags,
photos,
places,
positions,
tags,
users,
);