Add junction between relays and schedules
This commit is contained in:
parent
a90ea25b87
commit
2f51ebf91e
10 changed files with 209 additions and 53 deletions
emgauwa-lib/src/db
|
@ -7,7 +7,7 @@ use sqlx::Sqlite;
|
|||
|
||||
use crate::db::errors::DatabaseError;
|
||||
use crate::db::model_utils::Period;
|
||||
use crate::db::DbTag;
|
||||
use crate::db::{DbJunctionTag, DbTag};
|
||||
use crate::types::ScheduleUid;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
@ -166,7 +166,7 @@ impl DbSchedule {
|
|||
|
||||
for new_tag in new_tags {
|
||||
let tag: DbTag = DbTag::get_by_tag_or_create(conn, new_tag).await?;
|
||||
tag.link_schedule(conn, self).await?;
|
||||
DbJunctionTag::link_schedule(conn, &tag, self).await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue