mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-07-12 07:14:59 +00:00
Fix db issues with Option<> values and upd crates (#5594)
Some tables were lacking an option to convert Option<> to NULL. This commit will fix that. Also updated the crates to the latest version available.
This commit is contained in:
parent
d5c353427d
commit
3baffeee9a
6 changed files with 14 additions and 10 deletions
|
@ -11,6 +11,7 @@ use macros::UuidFromParam;
|
|||
db_object! {
|
||||
#[derive(Identifiable, Queryable, Insertable, AsChangeset)]
|
||||
#[diesel(table_name = collections)]
|
||||
#[diesel(treat_none_as_null = true)]
|
||||
#[diesel(primary_key(uuid))]
|
||||
pub struct Collection {
|
||||
pub uuid: CollectionId,
|
||||
|
|
|
@ -13,6 +13,7 @@ db_object! {
|
|||
// Upstream SQL: https://github.com/bitwarden/server/blob/8a22c0479e987e756ce7412c48a732f9002f0a2d/src/Sql/dbo/Tables/Event.sql
|
||||
#[derive(Identifiable, Queryable, Insertable, AsChangeset)]
|
||||
#[diesel(table_name = event)]
|
||||
#[diesel(treat_none_as_null = true)]
|
||||
#[diesel(primary_key(uuid))]
|
||||
pub struct Event {
|
||||
pub uuid: EventId,
|
||||
|
|
|
@ -10,6 +10,7 @@ use serde_json::Value;
|
|||
db_object! {
|
||||
#[derive(Identifiable, Queryable, Insertable, AsChangeset)]
|
||||
#[diesel(table_name = groups)]
|
||||
#[diesel(treat_none_as_null = true)]
|
||||
#[diesel(primary_key(uuid))]
|
||||
pub struct Group {
|
||||
pub uuid: GroupId,
|
||||
|
|
|
@ -17,6 +17,7 @@ use macros::UuidFromParam;
|
|||
db_object! {
|
||||
#[derive(Identifiable, Queryable, Insertable, AsChangeset)]
|
||||
#[diesel(table_name = organizations)]
|
||||
#[diesel(treat_none_as_null = true)]
|
||||
#[diesel(primary_key(uuid))]
|
||||
pub struct Organization {
|
||||
pub uuid: OrganizationId,
|
||||
|
@ -28,6 +29,7 @@ db_object! {
|
|||
|
||||
#[derive(Identifiable, Queryable, Insertable, AsChangeset)]
|
||||
#[diesel(table_name = users_organizations)]
|
||||
#[diesel(treat_none_as_null = true)]
|
||||
#[diesel(primary_key(uuid))]
|
||||
pub struct Membership {
|
||||
pub uuid: MembershipId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue