about summary refs log tree commit diff
path: root/src/models.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-05-01T19·37+0200
committerVincent Ambo <github@tazj.in>2018-05-01T22·33+0200
commit095293e8e3fc0e31a97d8c6d9f7a06c9547112a8 (patch)
tree1be5ca55e1b5cbdb49e76134d48467c741a9a1f7 /src/models.rs
parent1e57b879fbb1e76ba108846bd4fcb34472900f4f (diff)
feat(db): Add LookupOrCreateUser message
Adds a message to look up a user in the database based on their email
address. If the user does not exist, it is created.
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/models.rs b/src/models.rs
index 5c7bbb12d36a..3ad4a5ed9d7d 100644
--- a/src/models.rs
+++ b/src/models.rs
@@ -89,6 +89,13 @@ pub struct NewThread {
 }
 
 #[derive(Deserialize, Insertable)]
+#[table_name="users"]
+pub struct NewUser {
+    pub email: String,
+    pub name: String,
+}
+
+#[derive(Deserialize, Insertable)]
 #[table_name="posts"]
 pub struct NewPost {
     pub thread_id: i32,