tvl-depot/fun/paroxysm/src/models.rs
Vincent Ambo 82ba28f197 chore: Move //fun/tvldb -> //fun/paroxysm
Say ~my~ its name!

Change-Id: I7890318aef984af0f6bc011de32282f16e01cbb3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1483
Tested-by: BuildkiteCI
Reviewed-by: eta <eta@theta.eu.org>
2020-07-27 23:54:00 +00:00

36 lines
696 B
Rust

use crate::schema::{entries, keywords};
use chrono::NaiveDateTime;
#[derive(Queryable)]
pub struct Keyword {
pub id: i32,
pub name: String,
pub chan: String,
}
#[derive(Queryable)]
pub struct Entry {
pub id: i32,
pub keyword_id: i32,
pub idx: i32,
pub text: String,
pub creation_ts: NaiveDateTime,
pub created_by: String,
}
#[derive(Insertable)]
#[table_name = "keywords"]
pub struct NewKeyword<'a> {
pub name: &'a str,
pub chan: &'a str,
}
#[derive(Insertable)]
#[table_name = "entries"]
pub struct NewEntry<'a> {
pub keyword_id: i32,
pub idx: i32,
pub text: &'a str,
pub creation_ts: NaiveDateTime,
pub created_by: &'a str,
}