aboutsummaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-10-04 08:53:46 +0100
committerAkshay <[email protected]>2020-10-04 08:53:46 +0100
commit057382f8d138c63cdc48b0facd9bf4a4a229057a (patch)
treeb30ba227c49918e0e65fc14068307cf11a9248bc /src/models.rs
init
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/models.rs b/src/models.rs
new file mode 100644
index 0000000..ce28ac8
--- /dev/null
+++ b/src/models.rs
@@ -0,0 +1,21 @@
1use super::schema::members;
2use diesel::{Insertable, Queryable};
3use serde::{Deserialize, Serialize};
4
5#[derive(Queryable, Serialize)]
6pub struct Member {
7 pub id: i32,
8 pub username: String,
9 pub password: String,
10 pub phone_number: String,
11 pub email_id: String,
12}
13
14#[derive(Insertable, Deserialize)]
15#[table_name = "members"]
16pub struct NewMember {
17 pub username: String,
18 pub password: String,
19 pub phone_number: String,
20 pub email_id: String,
21}