fix(migration): Correctly migrate password column from v1.0.0 (Issue #1051) (#1052)

The migration was trying to copy from `password_digest`, but v1.0.0
databases have the column named `password`. This caused all passwords
to become NULL during migration, preventing users from logging in.

Fixed SELECT to read from `password` instead of `password_digest`.

Fixes #1051
This commit is contained in:
Chris 2026-04-21 01:12:04 +03:00 committed by GitHub
parent b9eaedc468
commit b3524dc01f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,11 +59,12 @@ module.exports = {
next_task_suggestion_enabled, today_settings, sidebar_settings,
ui_settings, notification_preferences, keyboard_shortcuts,
email_verified, email_verification_token,
email_verification_token_expires_at, created_at, updated_at
email_verification_token_expires_at, created_at, updated_at,
ai_provider, openai_api_key, ollama_base_url, ollama_model
)
SELECT
id, uid, name, surname, email,
COALESCE(password_digest, NULL) as password_digest,
password as password_digest,
appearance, language,
timezone, first_day_of_week, avatar_image, telegram_bot_token,
telegram_chat_id, task_summary_enabled, task_summary_frequency,
@ -73,7 +74,8 @@ module.exports = {
next_task_suggestion_enabled, today_settings, sidebar_settings,
ui_settings, notification_preferences, keyboard_shortcuts,
email_verified, email_verification_token,
email_verification_token_expires_at, created_at, updated_at
email_verification_token_expires_at, created_at, updated_at,
ai_provider, openai_api_key, ollama_base_url, ollama_model
FROM users;
`);