Fix migrations path and fmt
Some checks failed
/ build-artifacts (arm-unknown-linux-gnueabihf) (push) Failing after 9m27s

This commit is contained in:
Tobias Reisinger 2024-04-30 10:00:49 +02:00
parent 96a64cf90d
commit f539c47e3b
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
8 changed files with 1 additions and 8 deletions

View file

@ -17,7 +17,6 @@ pub struct DbMacro {
pub name: String,
}
impl DbMacro {
pub async fn get_all(conn: &mut PoolConnection<Sqlite>) -> Result<Vec<DbMacro>, DatabaseError> {
sqlx::query_as!(DbMacro, "SELECT * FROM macros")

View file

@ -15,7 +15,6 @@ pub struct DbMacroAction {
pub weekday: i64, // should be u8, but sqlite will store it as i64
}
impl DbMacroAction {
pub async fn get_all(
conn: &mut PoolConnection<Sqlite>,

View file

@ -25,7 +25,7 @@ pub use tag::DbTag;
use crate::errors::{DatabaseError, EmgauwaError};
static MIGRATOR: Migrator = sqlx::migrate!("../migrations"); // defaults to "./migrations"
static MIGRATOR: Migrator = sqlx::migrate!(); // defaults to "./migrations"
pub async fn run_migrations(pool: &Pool<Sqlite>) -> Result<(), EmgauwaError> {
log::info!("Running migrations");

View file

@ -19,7 +19,6 @@ pub struct DbRelay {
pub controller_id: i64,
}
impl DbRelay {
pub async fn get_all(conn: &mut PoolConnection<Sqlite>) -> Result<Vec<DbRelay>, DatabaseError> {
sqlx::query_as!(DbRelay, "SELECT * FROM relays")

View file

@ -14,7 +14,6 @@ pub struct Macro {
pub actions: Vec<MacroAction>,
}
impl FromDbModel for Macro {
type DbModel = DbMacro;
type DbModelCache = ();

View file

@ -14,7 +14,6 @@ pub struct MacroAction {
pub weekday: i64,
}
impl FromDbModel for MacroAction {
type DbModel = DbMacroAction;
type DbModelCache = ();

View file

@ -27,7 +27,6 @@ pub struct Relay {
pub pulsing: Option<Instant>,
}
impl FromDbModel for Relay {
type DbModel = DbRelay;
type DbModelCache = DbController;

View file

@ -10,7 +10,6 @@ use crate::errors::EmgauwaError;
use crate::settings::Permissions;
use crate::types::{RelayStates, Weekday};
pub fn init_logging(level: &str) -> Result<(), EmgauwaError> {
let log_level: LevelFilter = LevelFilter::from_str(level)
.map_err(|_| EmgauwaError::Other(format!("Invalid log level: {}", level)))?;