mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-03-12 01:45:56 -05:00
[PR #486] [CLOSED] [WIP/RFC] MySQL / MariaDB database backend support #2610
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/486
Author: @Skeen
Created: 5/20/2019
Status: ❌ Closed
Base:
master← Head:master📝 Commits (9)
42af7c6MySQL database85c8a01Merge branch 'master' of github.com:Skeen/bitwarden_rsab95a69Rework migrations for MySQLe22e290Fix key and type variable names for mysql233b48bFix missing joinable in schemaeb9d5e1Reintroduce .env.template5fb6531Attempt to fix azure pipeline6f78395Passwordless sudo on azure?badd22aMake docker image build📊 Changes
29 files changed (+199 additions, -210 deletions)
View changed files
📝
Cargo.lock(+12 -13)📝
Cargo.toml(+2 -5)📝
Dockerfile(+6 -0)📝
azure-pipelines.yml(+5 -0)📝
migrations/2018-01-14-171611_create_tables/up.sql(+16 -16)📝
migrations/2018-02-17-205753_create_collections_and_orgs/up.sql(+10 -11)📝
migrations/2018-04-27-155151_create_users_ciphers/up.sql(+8 -8)📝
migrations/2018-05-08-161616_create_collection_cipher_map/up.sql(+3 -3)📝
migrations/2018-05-25-232323_update_attachments_reference/up.sql(+3 -3)📝
migrations/2018-07-11-181453_create_u2f_twofactor/up.sql(+7 -7)📝
migrations/2018-09-10-111213_add_invites/up.sql(+2 -2)📝
migrations/2018-11-27-152651_add_att_key_columns/up.sql(+1 -1)📝
src/api/core/accounts.rs(+5 -5)📝
src/api/core/ciphers.rs(+3 -3)📝
src/api/core/mod.rs(+1 -1)📝
src/api/core/organizations.rs(+14 -14)📝
src/api/identity.rs(+4 -4)📝
src/auth.rs(+1 -1)📝
src/config.rs(+2 -1)📝
src/db/mod.rs(+6 -4)...and 9 more files
📄 Description
Hello,
This PR introduces support for MySQL as database backend (and in the current state, completely breaks support for SQLite in the process), thus resolving #208. MySQL was chosen due to diesel::replace_into support, as noted as a requirement here: #87.
The changes are mainly:
keytoakeyandtypetoatype(keyandtypeare reserved keywords in MySQL).VARCHAR(40)instead ofTEXTfor UUIDs (MySQL cannot useTEXTas keys, as it only (as far as I know) indexes up to 255 characters).The PR can be tested out, by starting a mysql docker container:
or a mariadb docker container:
And building the project via
cargo run, althrough we now need thelibmysql++-devdebian package.Now for the questions:
akeyandatypeis up for discussion, I just wanted to avoid the conflicts.db/mod.rswill have to be dynamic and configuration dependent.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.