Watch
1
0
Fork
You've already forked vaultwarden
0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2026-11-11 00:29:17 -05:00
vaultwarden/migrations/mysql
Repository files (latest commit first)
Filename Latest commit message Latest commit date
will-lottkowitz-prism d1cbd027cd
Add revision_date to org policies (#7571)
* Add revision_date to org policies

Org policy JSON responses never included a revisionDate field, unlike
every other synced entity. The official Bitwarden server always sets
it, and current official clients (recently migrated to the WASM SDK's
typed PolicyView) now assume it is always a valid date string. Its
absence deserializes to undefined client-side, which then throws
(RangeError: Invalid time value) when the client formats it, breaking
the whole policy sync pipeline and silently emptying the vault view in
the browser and desktop apps.

Adds a revision_date column (mirroring the existing pattern used by
Send), stamped on creation and bumped on every save.

* Fix migration correctness for org policy revision_date

Caught by review: SQLite rejects non-constant defaults in ALTER TABLE
ADD COLUMN, so the sqlite migration would fail outright on every
existing installation (vaultwarden's default backend) rather than the
postgresql setup this was developed against.

- sqlite/mysql: add the column with a constant placeholder default,
  then backfill via UPDATE, since neither allows a volatile default
  in ALTER TABLE ADD COLUMN (mysql does allow it, but a constant
  keeps the three backends' migrations symmetric).
- mysql: use DATETIME instead of TIMESTAMP, matching this repo's
  existing revision_date columns, and backfill with UTC_TIMESTAMP()
  instead of a session-timezone-dependent CURRENT_TIMESTAMP.
- postgresql: backfill with `now() AT TIME ZONE 'utc'` instead of a
  DEFAULT now(), since assigning timestamptz now() into this naive
  TIMESTAMP column would otherwise cast through the server's TimeZone
  GUC and store local wall-clock instead of UTC on non-UTC servers.
- mysql/postgresql: add a real down.sql (DROP COLUMN) instead of
  leaving it empty.

* Move org policy revision_date migration after the latest one

---------

Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2026-10-07 19:19:26 +02:00
..
2018-01-14-171611_create_tables user char(36) for uuid columns 2019-05-27 17:20:20 +02:00
2018-02-17-205753_create_collections_and_orgs user char(36) for uuid columns 2019-05-27 17:20:20 +02:00
2018-04-27-155151_create_users_ciphers user char(36) for uuid columns 2019-05-27 17:20:20 +02:00
2018-05-08-161616_create_collection_cipher_map user char(36) for uuid columns 2019-05-27 17:20:20 +02:00
2018-05-25-232323_update_attachments_reference user char(36) for uuid columns 2019-05-27 17:20:20 +02:00
2018-06-01-112529_update_devices_twofactor_remember initial mysql support 2019-05-26 23:03:05 +02:00
2018-07-11-181453_create_u2f_twofactor user char(36) for uuid columns 2019-05-27 17:20:20 +02:00
2018-08-27-172114_update_ciphers initial mysql support 2019-05-26 23:03:05 +02:00
2018-09-10-111213_add_invites initial mysql support 2019-05-26 23:03:05 +02:00
2018-09-19-144557_add_kdf_columns Updated client kdf iterations to 100000 and fixed some lints 2019-09-05 21:56:12 +02:00
2018-11-27-152651_add_att_key_columns initial mysql support 2019-05-26 23:03:05 +02:00
2019-05-26-216651_rename_key_and_type_columns initial mysql support 2019-05-26 23:03:05 +02:00
2019-10-10-083032_add_column_to_twofactor Updated authenticator TOTP 2019-10-10 17:32:20 +02:00
2019-11-17-011009_add_email_verification Implement change-email, email-verification, account-recovery, and welcome notifications 2019-11-24 22:28:49 -07:00
2020-03-13-205045_add_policy_table Initial version of policies 2020-03-14 13:32:28 +01:00
2020-04-09-235005_add_cipher_delete_date Initial support for soft deletes 2020-04-17 22:35:27 +02:00
2020-07-01-214531_add_hide_passwords Add support for hiding passwords in a collection 2020-07-02 21:51:20 -07:00
2020-08-02-025025_add_favorites_table Transfer favorite status for user-owned ciphers 2020-08-22 17:14:05 -07:00
2020-11-30-224000_add_user_enabled Implement admin ability to enable/disable users 2020-11-30 23:12:56 +01:00
2020-12-09-173101_add_stamp_exception Fix Key Rotation during password change 2020-12-14 19:58:23 +01:00
2021-03-11-190243_add_sends rename send key -> akey 2021-03-15 16:42:20 +01:00
2021-04-30-233251_add_reprompt Add support for password reprompt 2021-05-11 20:09:57 -07:00
2021-05-11-205202_add_hide_email Add support for hiding the sender's email address in Bitwarden Sends 2021-05-11 22:51:12 -07:00
2021-07-01-203140_add_password_reset_keys Added web-vault v2.21.x support + some misc fixes 2021-07-04 23:02:56 +02:00
2021-08-30-193501_create_emergency_access [PATCH] Some fixes to the Emergency Access PR 2021-09-17 01:25:47 +02:00
2021-10-24-164321_add_2fa_incomplete Add email notifications for incomplete 2FA logins 2021-10-28 00:19:43 -07:00
2022-01-17-234911_add_api_key Add support for API keys 2022-01-21 23:10:11 -08:00
2022-03-02-210038_update_devices_primary_key Update login API code 2022-03-12 18:45:45 +01:00
2022-07-27-110000_add_group_support group support 2022-10-20 15:31:53 +02:00
2022-10-18-170602_add_events Add Organizational event logging feature 2022-11-27 23:36:34 +01:00
2023-01-06-151600_add_reset_password_support Replaced wrong mysql column type 2023-02-04 09:23:13 +01:00
2023-01-11-205851_add_avatar_color Add avatar color support 2023-01-11 22:20:03 +01:00
2023-01-31-222222_add_argon2 add argon2 kdf fields 2023-02-07 13:52:52 -05:00
2023-02-18-125735_push_uuid_table feat: Push Notifications 2023-06-11 13:28:18 +02:00
2023-06-02-200424_create_organization_api_key Merge and modify PR from @Kurnihil 2023-06-13 08:51:07 +02:00
2023-06-17-200424_create_auth_requests_table Implement login-with-device 2023-08-13 17:54:18 +02:00
2023-06-28-133700_add_collection_external_id Added-External_id for Collections 2023-07-04 20:26:03 +02:00
2023-09-01-170620_update_auth_request_table Fix Login With Device without MasterPassword 2023-09-01 21:03:50 +02:00
2023-09-02-212336_move_user_external_id Fix External ID not set during DC Sync 2023-10-21 13:54:48 +02:00
2023-09-10-133000_add_sso SSO using OpenID Connect (#3899) 2025-08-08 23:22:22 +02:00
2023-09-14-133000_add_users_organizations_invited_by_email SSO using OpenID Connect (#3899) 2025-08-08 23:22:22 +02:00
2023-10-21-221242_add_cipher_key Fix issue with MariaDB/MySQL migrations (#3994) 2023-10-23 12:23:35 +02:00
2024-01-12-210182_change_attachment_size Improve file limit handling (#4242) 2024-01-27 02:43:26 +01:00
2024-02-14-135828_change_time_stamp_data_type Change timestamp data type. (#4355) 2024-03-17 22:04:37 +01:00
2024-02-14-170000_add_state_to_sso_nonce SSO using OpenID Connect (#3899) 2025-08-08 23:22:22 +02:00
2024-02-26-170000_add_pkce_to_sso_nonce SSO using OpenID Connect (#3899) 2025-08-08 23:22:22 +02:00
2024-03-06-170000_add_sso_users SSO using OpenID Connect (#3899) 2025-08-08 23:22:22 +02:00
2024-03-13-170000_sso_users_cascade Fix migration for MariaDB 12.2.2 (#7265) 2026-08-29 17:02:01 +02:00
2024-06-05-131359_add_2fa_duo_store Add support for MFA with Duo's Universal Prompt (#4637) 2024-07-24 16:50:35 +02:00
2024-09-04-091351_use_device_type_for_mails Fix Device Type column for 2FA migration (#4971) 2024-09-20 12:06:06 +02:00
2025-01-09-172300_add_manage Add manage role for collections and groups (#5386) 2025-01-21 23:33:41 +01:00
2025-08-20-120000_sso_nonce_to_auth Improve sso auth flow (#6205) 2025-12-06 22:20:04 +01:00
2026-03-09-005927_add_archives Add support for archiving items (#6916) 2026-04-29 22:29:42 +02:00
2026-04-25-120000_sso_auth_binding Several SSO Fixes (#7163) 2026-04-29 22:25:36 +02:00
2026-05-05-120000_sso_auth_error sso_auth improvements (#7197) 2026-05-16 21:18:46 +02:00
2026-09-02-120000_add_key_id User key id (#7693) 2026-09-18 16:53:06 +02:00
2026-10-07-120000_add_org_policy_revision_date Add revision_date to org policies (#7571) 2026-10-07 19:19:26 +02:00