Matching model, table and schema
This commit is contained in:
@@ -1,28 +1,29 @@
|
||||
use std::f64::consts::PI;
|
||||
use diesel::prelude::*;
|
||||
use std::f64::consts::PI;
|
||||
|
||||
use crate::{unit_conversion::UnitsConversion, Point};
|
||||
|
||||
#[derive(Debug, Clone, Default,Queryable, Selectable)]
|
||||
#[derive(Debug, Clone, Default, Queryable, Selectable, serde::Serialize, serde::Deserialize)]
|
||||
#[diesel(check_for_backend(diesel::pg::Pg))]
|
||||
#[diesel(table_name = crate::schema::antennas)]
|
||||
pub struct Antenna {
|
||||
pub id: String,
|
||||
pub tssi: f64,
|
||||
pub pos_x: f64,
|
||||
pub pos_y: f64,
|
||||
pub pos_z: f64,
|
||||
pub comment: Option<String>,
|
||||
pos_x: f64,
|
||||
pos_y: f64,
|
||||
pos_z: f64,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[derive(Debug, Clone, Copy, Insertable, AsChangeset, serde::Deserialize)]
|
||||
#[diesel(table_name = crate::schema::antennas)]
|
||||
pub struct NewAntenna<'a> {
|
||||
id: &'a str,
|
||||
comment: Option<&'a str>,
|
||||
tssi: f64,
|
||||
pos_x: f64,
|
||||
pos_y: f64,
|
||||
pos_z: f64,
|
||||
pub id: &'a str,
|
||||
pub tssi: f64,
|
||||
pub pos_x: f64,
|
||||
pub pos_y: f64,
|
||||
pub pos_z: f64,
|
||||
pub comment: Option<&'a str>,
|
||||
}
|
||||
|
||||
impl Antenna {
|
||||
|
||||
Reference in New Issue
Block a user