151 lines
2.5 KiB
Rust
151 lines
2.5 KiB
Rust
table! {
|
|
attributions (id) {
|
|
id -> Int4,
|
|
name -> Varchar,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
cameras (id) {
|
|
id -> Int4,
|
|
manufacturer -> Varchar,
|
|
model -> Varchar,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
people (id) {
|
|
id -> Int4,
|
|
slug -> Varchar,
|
|
person_name -> Varchar,
|
|
// image
|
|
}
|
|
}
|
|
|
|
table! {
|
|
object_kind (id) {
|
|
id -> Int4,
|
|
name -> Varchar,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
object (id) {
|
|
id -> Int4,
|
|
kind_id: Int4,
|
|
bbox: BBox,
|
|
// image
|
|
}
|
|
}
|
|
|
|
table! {
|
|
object_attribute_kind (id) {
|
|
id -> Int4,
|
|
name -> Varchar,
|
|
data_type: DataType,
|
|
schema_url -> Nullable<Varchar>,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
object_attribute (id) {
|
|
id -> Int4,
|
|
kind_id -> Int4,
|
|
data -> Json,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
photo_people (photo_id, person_id) {
|
|
photo_id -> Int4,
|
|
person_id -> Int4,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
photo_places (photo_id, place_id) {
|
|
photo_id -> Int4,
|
|
place_id -> Int4,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
photo_tags (photo_id, tag_id) {
|
|
photo_id -> Int4,
|
|
tag_id -> Int4,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
photos (id) {
|
|
id -> Int4,
|
|
path -> Varchar,
|
|
camera_id -> Nullable<Int4>,
|
|
attribution_id -> Nullable<Int4>,
|
|
date -> Nullable<Timestamp>,
|
|
grade -> Nullable<Int2>,
|
|
rotation -> Int2,
|
|
width -> Int4,
|
|
height -> Int4,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
places (id) {
|
|
id -> Int4,
|
|
slug -> Varchar,
|
|
place_name -> Varchar,
|
|
osm_id -> Nullable<Int8>,
|
|
osm_level -> Nullable<Int2>,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
positions (id) {
|
|
id -> Int4,
|
|
photo_id -> Int4,
|
|
latitude -> Int4,
|
|
longitude -> Int4,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
tags (id) {
|
|
id -> Int4,
|
|
slug -> Varchar,
|
|
tag_name -> Varchar,
|
|
}
|
|
}
|
|
|
|
table! {
|
|
users (id) {
|
|
id -> Int4,
|
|
username -> Varchar,
|
|
password -> Varchar,
|
|
}
|
|
}
|
|
|
|
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,
|
|
);
|