Cleanup db/schedule namespace
This commit is contained in:
parent
09c50411d1
commit
effd3f3b18
8 changed files with 155 additions and 209 deletions
src
|
@ -5,7 +5,7 @@ use sqlx::{Pool, Sqlite};
|
|||
|
||||
use crate::db::errors::DatabaseError;
|
||||
use crate::db::model_utils::Period;
|
||||
use crate::db::models::{Periods, Schedule};
|
||||
use crate::db::schedules::{Periods, Schedule};
|
||||
use crate::types::EmgauwaUid;
|
||||
|
||||
pub mod errors;
|
||||
|
@ -29,7 +29,7 @@ async fn init_schedule(
|
|||
periods: Periods,
|
||||
) -> Result<(), DatabaseError> {
|
||||
trace!("Initializing schedule {:?}", name);
|
||||
match schedules::get_schedule_by_uid(&mut pool.acquire().await.unwrap(), uid).await {
|
||||
match Schedule::get_by_uid(&mut pool.acquire().await.unwrap(), uid).await {
|
||||
Ok(_) => Ok(()),
|
||||
Err(err) => match err {
|
||||
DatabaseError::NotFound => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue