Switch spaces to tabs

This commit is contained in:
Tobias Reisinger 2022-07-20 00:38:09 +02:00
parent 07aca5293e
commit 4261141c3a
17 changed files with 560 additions and 557 deletions
src/db

View file

@ -7,27 +7,27 @@ use crate::types::EmgauwaUid;
#[derive(Debug, Serialize, Identifiable, Queryable)]
pub struct Relay {
#[serde(skip)]
pub id: i32,
// TODO
#[serde(skip)]
pub id: i32,
// TODO
}
#[derive(Debug, Serialize, Identifiable, Queryable, Clone)]
pub struct Schedule {
#[serde(skip)]
pub id: i32,
#[serde(rename(serialize = "id"))]
pub uid: EmgauwaUid,
pub name: String,
pub periods: Periods,
#[serde(skip)]
pub id: i32,
#[serde(rename(serialize = "id"))]
pub uid: EmgauwaUid,
pub name: String,
pub periods: Periods,
}
#[derive(Insertable)]
#[table_name = "schedules"]
pub struct NewSchedule<'a> {
pub uid: &'a EmgauwaUid,
pub name: &'a str,
pub periods: &'a Periods,
pub uid: &'a EmgauwaUid,
pub name: &'a str,
pub periods: &'a Periods,
}
#[derive(Debug, Serialize, Deserialize, AsExpression, FromSqlRow, PartialEq, Clone)]
@ -36,14 +36,14 @@ pub struct Periods(pub(crate) Vec<Period>);
#[derive(Debug, Serialize, Identifiable, Queryable, Clone)]
pub struct Tag {
pub id: i32,
pub tag: String,
pub id: i32,
pub tag: String,
}
#[derive(Insertable)]
#[table_name = "tags"]
pub struct NewTag<'a> {
pub tag: &'a str,
pub tag: &'a str,
}
#[derive(Queryable, Associations, Identifiable)]
@ -52,16 +52,16 @@ pub struct NewTag<'a> {
#[belongs_to(Tag)]
#[table_name = "junction_tag"]
pub struct JunctionTag {
pub id: i32,
pub tag_id: i32,
pub relay_id: Option<i32>,
pub schedule_id: Option<i32>,
pub id: i32,
pub tag_id: i32,
pub relay_id: Option<i32>,
pub schedule_id: Option<i32>,
}
#[derive(Insertable)]
#[table_name = "junction_tag"]
pub struct NewJunctionTag {
pub tag_id: i32,
pub relay_id: Option<i32>,
pub schedule_id: Option<i32>,
pub tag_id: i32,
pub relay_id: Option<i32>,
pub schedule_id: Option<i32>,
}