From 22a1fd17308b8c3f7df5653b1919ef48a55aa159 Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 6 May 2020 22:18:51 -0700 Subject: [PATCH] Fixed issue with User database responses: Added insertable to ensure compilation even though we dont use that trait --- server/src/models.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/src/models.rs b/server/src/models.rs index ccb65b4..0f3e41f 100644 --- a/server/src/models.rs +++ b/server/src/models.rs @@ -7,19 +7,22 @@ pub struct Invite { pub uses: i32, } -#[derive(Serialize, Deserialize, Queryable, Debug)] + +#[derive(Insertable)] #[table_name = "users"] -pub struct User { - pub userid: u64, - pub username: String, +pub struct InsertableUser { + pub name: String, pub secret: String, pub date: u64, pub status: i32, } -#[derive(Insertable) +// NOTE: Insertable is the only rls stop complaining at us about `table_name` not being found in scope +// its dumb but its how we're going to compile this, with some dead code +#[derive(Insertable, Serialize, Deserialize, Queryable, Debug)] #[table_name = "users"] -pub struct InsertableUser { +pub struct User { + pub id: u64, pub name: String, pub secret: String, pub date: u64,