Works
This commit is contained in:
@@ -14,6 +14,6 @@ pub fn init_db(database_url: &str) -> PgConnection {
|
||||
connection
|
||||
.run_pending_migrations(MIGRATIONS)
|
||||
.unwrap_or_else(|e| panic!("Error running migrations: {e}"));
|
||||
|
||||
log::info!("Connected to database");
|
||||
connection
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use chrono::NaiveDateTime;
|
||||
use diesel::prelude::*;
|
||||
|
||||
#[derive(Queryable, Selectable)]
|
||||
#[derive(Debug, Queryable, Selectable)]
|
||||
#[diesel(table_name = crate::db::schema::antennas)]
|
||||
#[diesel(check_for_backend(diesel::pg::Pg))]
|
||||
pub struct Antenna {
|
||||
@@ -11,7 +11,7 @@ pub struct Antenna {
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[derive(Debug, Insertable)]
|
||||
#[diesel(table_name = crate::db::schema::antennas)]
|
||||
pub struct NewAntenna {
|
||||
pub name: String,
|
||||
@@ -19,7 +19,7 @@ pub struct NewAntenna {
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Queryable, Selectable)]
|
||||
#[derive(Debug, Queryable, Selectable)]
|
||||
#[diesel(table_name = crate::db::schema::client_readings)]
|
||||
#[diesel(check_for_backend(diesel::pg::Pg))]
|
||||
pub struct ClientReading {
|
||||
@@ -31,7 +31,7 @@ pub struct ClientReading {
|
||||
pub read_at: NaiveDateTime,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
#[derive(Debug, Insertable)]
|
||||
#[diesel(table_name = crate::db::schema::client_readings)]
|
||||
pub struct NewClientReading {
|
||||
pub ip: String,
|
||||
|
||||
Reference in New Issue
Block a user