WIP account registration
This commit is contained in:
parent
f4d9c1a3c4
commit
2ba4aa8c8e
14 changed files with 419 additions and 19 deletions
33
src/db/models.rs
Normal file
33
src/db/models.rs
Normal file
|
@ -0,0 +1,33 @@
|
|||
use diesel::prelude::*;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use super::schema::accounts;
|
||||
|
||||
#[derive(Queryable, Serialize)]
|
||||
pub struct Account {
|
||||
pub id: i32,
|
||||
|
||||
pub username: String,
|
||||
pub gjp2: String,
|
||||
pub email: String,
|
||||
|
||||
pub is_admin: i32,
|
||||
|
||||
pub messages_enabled: i32,
|
||||
pub comments_enabled: i32,
|
||||
|
||||
pub friend_requests_enabled: i32,
|
||||
|
||||
pub youtube_url: Option<String>,
|
||||
pub twitter_url: Option<String>,
|
||||
pub twitch_url: Option<String>,
|
||||
|
||||
pub created_at: String
|
||||
}
|
||||
|
||||
#[derive(Insertable, Deserialize)]
|
||||
#[diesel(table_name = accounts)]
|
||||
pub struct NewAccount {
|
||||
pub username: String,
|
||||
pub gjp2: String,
|
||||
pub email: String
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue