Basic Database

This commit is contained in:
Jai A
2020-05-14 22:53:22 -07:00
parent c29ab25dd2
commit fee34ba257
23 changed files with 459 additions and 155 deletions

31
src/database/models.rs Normal file
View File

@@ -0,0 +1,31 @@
use serde::{Deserialize, Serialize};
use crate::schema::mods;
#[derive(Queryable)]
pub struct Mod {
pub id: i32,
pub title: String,
pub description: String,
pub published: String,
pub author: String,
pub downloads: i32,
pub categories: Vec<String>,
pub body_path: String,
pub icon_path: String
}
#[derive(Queryable)]
pub struct Version {
pub id: i32,
pub mod_id: i32,
pub title: String,
pub changelog_path: String,
pub files_path: Vec<String>,
pub date_published: String,
pub author: String,
pub downloads: i32,
pub dependencies: Vec<String>,
pub game_versions: Vec<String>
}