Add junction between relays and schedules

This commit is contained in:
Tobias Reisinger 2023-11-30 00:57:03 +01:00
parent a90ea25b87
commit 2f51ebf91e
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
10 changed files with 209 additions and 53 deletions
emgauwa-lib/src/db

View file

@ -5,7 +5,7 @@ use sqlx::pool::PoolConnection;
use sqlx::Sqlite;
use crate::db::errors::DatabaseError;
use crate::db::{DbController, DbTag};
use crate::db::{DbController, DbJunctionTag, DbTag};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DbRelay {
@ -153,7 +153,7 @@ impl DbRelay {
for new_tag in new_tags {
let tag: DbTag = DbTag::get_by_tag_or_create(conn, new_tag).await?;
tag.link_relay(conn, self).await?;
DbJunctionTag::link_relay(conn, &tag, self).await?;
}
Ok(())
}