Add new tables, add automatic data cleanup with configurable duration, move company business logic into seperate folder

This commit is contained in:
2026-09-07 16:41:26 +03:00
parent ac6f935239
commit 666ef42688
16 changed files with 537 additions and 254 deletions

View File

@@ -1,28 +1,65 @@
// Written manually because diesel cant fucking read the db properly for some reason
// @generated automatically by Diesel CLI.
diesel::table! {
antennas (id) {
id -> Int8,
id -> Bigint,
name -> Text,
ip -> Text,
#[max_length = 15]
ip -> Varchar,
error -> Nullable<Text>,
last_error_t -> Nullable<Timestamp>,
}
}
diesel::table! {
client_readings (id) {
id -> Int8,
ip -> Text,
mac -> Text,
antenna_ip -> Text,
db_reading -> Int4,
id -> Bigint,
#[max_length = 15]
ip -> Nullable<Varchar>,
#[max_length = 17]
mac -> Varchar,
#[max_length = 15]
antenna_ip -> Varchar,
read_at -> Timestamp,
tx_ccq -> Int4,
rx_ccq -> Int4,
radio_name -> Varchar,
tx_rate -> Varchar,
rx_rate -> Varchar,
db_reading -> Integer,
tx_ccq -> Nullable<Integer>,
rx_ccq -> Nullable<Integer>,
#[max_length = 255]
radio_name -> Nullable<Varchar>,
#[max_length = 50]
tx_rate -> Nullable<Varchar>,
#[max_length = 50]
rx_rate -> Nullable<Varchar>,
}
}
diesel::allow_tables_to_appear_in_same_query!(antennas, client_readings,);
diesel::table! {
client_statistics (id) {
id -> Bigint,
#[max_length = 15]
ip -> Nullable<Varchar>,
#[max_length = 17]
mac -> Varchar,
#[max_length = 15]
antenna_ip -> Varchar,
read_at -> Timestamp,
db_reading -> Integer,
tx_ccq -> Nullable<Integer>,
rx_ccq -> Nullable<Integer>,
#[max_length = 255]
radio_name -> Nullable<Varchar>,
#[max_length = 50]
tx_rate -> Nullable<Varchar>,
#[max_length = 50]
rx_rate -> Nullable<Varchar>,
}
}
diesel::table! {
wara (id) {
id -> Bigint,
last_client_reading_cleanup -> Nullable<Timestamp>,
}
}
diesel::allow_tables_to_appear_in_same_query!(antennas, client_readings, client_statistics, wara,);