[PR #1150] [MERGED] Fixed foreign-key (mariadb) errors. #26463

Closed
opened 2026-06-15 13:58:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/1150
Author: @BlackDex
Created: 9/21/2020
Status: Merged
Merged: 9/27/2020
Merged by: @dani-garcia

Base: masterHead: mariadb-fk-issues


📝 Commits (2)

  • 978be0b Fixed foreign-key (mariadb) errors.
  • c698bca Merge branch 'master' into mariadb-fk-issues

📊 Changes

8 files changed (+170 additions, -45 deletions)

View changed files

📝 src/db/models/attachment.rs (+13 -2)
📝 src/db/models/cipher.rs (+16 -5)
📝 src/db/models/collection.rs (+40 -9)
📝 src/db/models/folder.rs (+22 -8)
📝 src/db/models/org_policy.rs (+14 -3)
📝 src/db/models/organization.rs (+32 -9)
📝 src/db/models/two_factor.rs (+15 -4)
📝 src/db/models/user.rs (+18 -5)

📄 Description

When using MariaDB v10.5+ Foreign-Key errors were popping up because of
some changes in that version. To mitigate this on MariaDB and other
MySQL forks those errors are now catched, and instead of a replace_into
an update will happen. I have tested this as thorough as possible with
MariaDB 10.5, 10.4, 10.3 and the default MySQL on Ubuntu Focal. And
tested it again using sqlite, all seems to be ok on all tables.

resolves #1081. resolves #1065, resolves #1050, resolves #1159


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/1150 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 9/21/2020 **Status:** ✅ Merged **Merged:** 9/27/2020 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `master` ← **Head:** `mariadb-fk-issues` --- ### 📝 Commits (2) - [`978be0b`](https://github.com/dani-garcia/vaultwarden/commit/978be0b4a9a904a2ffbd227821cf8f14cf4e4243) Fixed foreign-key (mariadb) errors. - [`c698bca`](https://github.com/dani-garcia/vaultwarden/commit/c698bca2b934aee83ed33668a7513d9c3db223bf) Merge branch 'master' into mariadb-fk-issues ### 📊 Changes **8 files changed** (+170 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `src/db/models/attachment.rs` (+13 -2) 📝 `src/db/models/cipher.rs` (+16 -5) 📝 `src/db/models/collection.rs` (+40 -9) 📝 `src/db/models/folder.rs` (+22 -8) 📝 `src/db/models/org_policy.rs` (+14 -3) 📝 `src/db/models/organization.rs` (+32 -9) 📝 `src/db/models/two_factor.rs` (+15 -4) 📝 `src/db/models/user.rs` (+18 -5) </details> ### 📄 Description When using MariaDB v10.5+ Foreign-Key errors were popping up because of some changes in that version. To mitigate this on MariaDB and other MySQL forks those errors are now catched, and instead of a replace_into an update will happen. I have tested this as thorough as possible with MariaDB 10.5, 10.4, 10.3 and the default MySQL on Ubuntu Focal. And tested it again using sqlite, all seems to be ok on all tables. resolves #1081. resolves #1065, resolves #1050, resolves #1159 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-15 13:58:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#26463