Quit using diesel_infer_schema.
Instead, let diesel keep src/schema.rs up-to-date when migrating.
This commit is contained in:
parent
e5e1ff0234
commit
1d862962b6
@ -23,7 +23,6 @@ image = "^0.19.0"
|
||||
time = "*"
|
||||
kamadak-exif = "~0.3.0"
|
||||
diesel = { version = "~1.2.2", features = ["chrono", "postgres"] }
|
||||
diesel_infer_schema = { version = "~1.2.0", features = ["postgres"] }
|
||||
r2d2-diesel = "^1.0.0"
|
||||
r2d2 = "^0.8.2" # Must match version used by r2d2-diesel
|
||||
rustc-serialize = "0.3.24" # Must match version used by nickel
|
||||
|
5
diesel.toml
Normal file
5
diesel.toml
Normal file
@ -0,0 +1,5 @@
|
||||
# For documentation on how to configure this file,
|
||||
# see diesel.rs/guides/configuring-diesel-cli
|
||||
|
||||
[print_schema]
|
||||
file = "src/schema.rs"
|
@ -4,8 +4,6 @@ extern crate chrono;
|
||||
extern crate clap;
|
||||
#[macro_use]
|
||||
extern crate diesel;
|
||||
#[macro_use]
|
||||
extern crate diesel_infer_schema;
|
||||
extern crate djangohashers;
|
||||
extern crate dotenv;
|
||||
extern crate env_logger;
|
||||
|
119
src/schema.rs
119
src/schema.rs
@ -1 +1,118 @@
|
||||
infer_schema!("dotenv:DATABASE_URL");
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
photo_people (id) {
|
||||
id -> Int4,
|
||||
photo_id -> Int4,
|
||||
person_id -> Int4,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
photo_places (id) {
|
||||
id -> Int4,
|
||||
photo_id -> Int4,
|
||||
place_id -> Int4,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
photos (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 -> Nullable<Int4>,
|
||||
height -> Nullable<Int4>,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
photo_tags (id) {
|
||||
id -> Int4,
|
||||
photo_id -> Int4,
|
||||
tag_id -> Int4,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
places (id) {
|
||||
id -> Int4,
|
||||
slug -> Varchar,
|
||||
place_name -> Varchar,
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
photos,
|
||||
photo_tags,
|
||||
places,
|
||||
positions,
|
||||
tags,
|
||||
users,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user