ddstats/src/database/map.rs

22 lines
662 B
Rust

use mysql_common::chrono::NaiveDateTime;
use rocket::serde::{Serialize, Deserialize};
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(crate = "rocket::serde")]
pub struct Map {
pub name: String,
pub server: String,
pub points: i8,
pub stars: i8,
pub mapper: String,
pub timestamp: NaiveDateTime
}
/*
IMPORTANT: For this to work the following SQL query must be executed:
```SQL
UPDATE record_maps SET Timestamp='1970-01-01 01:01:01' WHERE Timestamp='1990-01-01 00:00:00';
```
Else the reads on `record_maps` will fail whenever the timestamp is '0000-00-00 00:00:00'!
TODO: Fix this server-side.
*/