commit 5a390a973ffcc5d7c75a18c441c554f8c6a54010
parent e3feba2a2cc928e05d4f7372913741029f095dce
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Wed, 15 Apr 2020 17:15:59 +0200
Merge pull request #966 from BlackDex/issue-965
Fixed issue #965
Diffstat:
4 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/db/models/attachment.rs b/src/db/models/attachment.rs
@@ -5,6 +5,7 @@ use crate::CONFIG;
#[derive(Debug, Identifiable, Queryable, Insertable, Associations, AsChangeset)]
#[table_name = "attachments"]
+#[changeset_options(treat_none_as_null="true")]
#[belongs_to(Cipher, foreign_key = "cipher_uuid")]
#[primary_key(id)]
pub struct Attachment {
diff --git a/src/db/models/cipher.rs b/src/db/models/cipher.rs
@@ -7,6 +7,7 @@ use super::{
#[derive(Debug, Identifiable, Queryable, Insertable, Associations, AsChangeset)]
#[table_name = "ciphers"]
+#[changeset_options(treat_none_as_null="true")]
#[belongs_to(User, foreign_key = "user_uuid")]
#[belongs_to(Organization, foreign_key = "organization_uuid")]
#[primary_key(uuid)]
diff --git a/src/db/models/device.rs b/src/db/models/device.rs
@@ -5,6 +5,7 @@ use crate::CONFIG;
#[derive(Debug, Identifiable, Queryable, Insertable, Associations, AsChangeset)]
#[table_name = "devices"]
+#[changeset_options(treat_none_as_null="true")]
#[belongs_to(User, foreign_key = "user_uuid")]
#[primary_key(uuid)]
pub struct Device {
diff --git a/src/db/models/user.rs b/src/db/models/user.rs
@@ -6,6 +6,7 @@ use crate::CONFIG;
#[derive(Debug, Identifiable, Queryable, Insertable, AsChangeset)]
#[table_name = "users"]
+#[changeset_options(treat_none_as_null="true")]
#[primary_key(uuid)]
pub struct User {
pub uuid: String,