fish_lib/
schema.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diesel::table! {
    fish_users (id) {
        id -> BigInt,
        external_id -> BigInt,
        created_at -> Timestamptz,
        updated_at -> Timestamptz,
        timezone -> VarChar
    }
}

diesel::table! {
    fish_specimens (id) {
        id -> BigInt,
        user_id -> BigInt,
        species_id -> Integer,
        created_at -> Timestamptz,
        updated_at -> Timestamptz,
        size_baby_ratio -> Float,
        size_adult_ratio -> Float,
        lifespan_days_ratio -> Float,
        catch_age -> Float
    }
}

diesel::table! {
    fish_ponds (id) {
        id -> BigInt,
        user_id -> BigInt,
        created_at -> Timestamptz,
        updated_at -> Timestamptz,
        capacity -> Integer
    }
}

diesel::table! {
    fish_fishing_history_entries (id) {
        id -> BigInt,
        user_id -> BigInt,
        species_id -> Integer,
        created_at -> Timestamptz,
        updated_at -> Timestamptz,
        caught_count -> Integer,
        sold_count -> Integer,
        smallest_catch_size_ratio -> Float,
        largest_catch_size_ratio -> Float,
        last_catch -> Timestamptz,
        first_sell -> Nullable<Timestamptz>,
        last_sell -> Nullable<Timestamptz>,
    }
}

diesel::joinable!(fish_specimens -> fish_users (user_id));
diesel::allow_tables_to_appear_in_same_query!(fish_specimens, fish_users);

diesel::joinable!(fish_ponds -> fish_users (user_id));
diesel::allow_tables_to_appear_in_same_query!(fish_ponds, fish_users);

diesel::joinable!(fish_fishing_history_entries -> fish_users (user_id));
diesel::allow_tables_to_appear_in_same_query!(fish_fishing_history_entries, fish_users);