2020-04-23 03:28:51 +00:00
|
|
|
use super::schema::events;
|
2020-04-26 20:06:55 +00:00
|
|
|
use chrono::NaiveDateTime;
|
2020-04-23 03:28:51 +00:00
|
|
|
|
|
|
|
#[derive(Queryable)]
|
|
|
|
pub struct Event {
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event ID
|
2020-04-23 03:28:51 +00:00
|
|
|
pub id: i32,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event name
|
2020-04-23 03:28:51 +00:00
|
|
|
pub event_name: String,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event long description
|
2020-04-23 03:28:51 +00:00
|
|
|
pub event_desc: String,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event datetime
|
2020-04-23 03:28:51 +00:00
|
|
|
pub event_time: NaiveDateTime,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event discord message id
|
2020-04-23 03:28:51 +00:00
|
|
|
pub message_id: String,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event message thumbnail link
|
2020-04-23 03:28:51 +00:00
|
|
|
pub thumbnail_link: String,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Reminder sent tracker
|
2020-04-26 01:04:13 +00:00
|
|
|
pub reminder_sent: i32,
|
2020-04-23 03:28:51 +00:00
|
|
|
}
|
|
|
|
|
2020-04-26 20:06:55 +00:00
|
|
|
#[derive(Insertable, Clone)]
|
|
|
|
#[table_name = "events"]
|
2020-04-24 00:45:02 +00:00
|
|
|
pub struct NewEvent {
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event name
|
2020-04-24 00:45:02 +00:00
|
|
|
pub event_name: String,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event long description
|
2020-04-24 00:45:02 +00:00
|
|
|
pub event_desc: String,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event datetime
|
2020-04-24 00:45:02 +00:00
|
|
|
pub event_time: NaiveDateTime,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event discord message id
|
2020-04-24 00:45:02 +00:00
|
|
|
pub message_id: String,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Event message thumbnail link
|
2020-04-24 00:45:02 +00:00
|
|
|
pub thumbnail_link: String,
|
2020-04-26 20:06:55 +00:00
|
|
|
/// Reminder sent tracker
|
2020-04-26 01:04:13 +00:00
|
|
|
pub reminder_sent: i32,
|
2020-04-23 03:28:51 +00:00
|
|
|
}
|