tududi/backend/migrations
Chris 7948f6552c
fix: make password_digest migration compatible with all schema versions (#1078)
* fix: replace 6-word limit with 150-character limit for project names

Replaces the word-based validation with character-based validation
as originally requested in #971. The 6-word limit was causing issues
with small words and separators being counted equally, and didn't
match the original requirement for a character limit.

Changes:
- Backend: Replace wordCount validator with len validator (1-150 chars)
- Frontend: Replace word count validation with character length check
- UI already has line-clamp-3 for display truncation

Fixes #998

* fix: make password_digest migration compatible with all schema versions

Fixes a critical bug where the make-password-optional migration would silently
fail when upgrading from v1.0.0 or running on fresh v1.1.0-dev installations.

The migration was trying to SELECT columns (ai_provider, openai_api_key,
ollama_base_url, ollama_model) that don't exist in the users table at that
point in the migration chain, causing the INSERT...SELECT to fail and leaving
password_digest as NOT NULL. This prevented OIDC auto-provisioning from
creating new users without passwords.

The fix dynamically detects which columns exist in the users table using
PRAGMA table_info and only selects columns that are guaranteed to exist.
Missing columns (AI-related fields) will receive their default values from
the new table schema.

Changes:
- Added dynamic column detection using PRAGMA table_info
- Only SELECT columns that exist in the current users table
- AI columns get default values if they don't exist yet
- Applied same fix to both up and down migrations
- Properly handle password/password_digest column name migration

Fixes #1075
2026-04-26 10:07:55 +03:00
..
20250116000000-add-first-day-of-week-to-users.js Feat add first day of week (#339) 2025-09-18 12:57:28 +03:00
20250615000001-create-users.js Linting cleanup (#99) 2025-07-01 11:40:09 +03:00
20250618000001-enhance-recurring-tasks.js Fix recurring structure (#646) 2025-12-04 13:29:37 +02:00
20250619000001-add-recurring-parent-id.js Fix recurring structure (#646) 2025-12-04 13:29:37 +02:00
20250619000002-add-project-image-url.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250620000001-add-task-intelligence-enabled.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250620000002-add-auto-suggest-next-actions-enabled.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250621221841-add-completed-at-to-tasks.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250621223000-create-calendar-tokens.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250622000001-create-task-events.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250622053925-add-pomodoro-enabled-to-users.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250623000001-add-uuid-to-tasks.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250623000003-create-notes-tags-table.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250623000004-add-timestamps-to-notes-tags.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250623000005-add-timestamps-to-projects-tags.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250711000001-add-suggestion-metadata-to-inbox-items.js Lint & format (#159) 2025-07-15 10:44:02 +03:00
20250713072131-add-productivity-assistant-columns.js Fix recurring structure (#646) 2025-12-04 13:29:37 +02:00
20250713233301-add-title-to-inbox-items.js Cleanup and add safe utility functions (#154) 2025-07-15 10:44:02 +03:00
20250716085710-add-parent-task-id-to-tasks.js Fix migration for duplicate column, fixes #202 2025-07-31 14:02:42 +03:00
20250722051746-add-today-settings-to-users.js Fix recurring structure (#646) 2025-12-04 13:29:37 +02:00
20250722052000-add-task-sorting-columns-to-projects.js Fix recurring structure (#646) 2025-12-04 13:29:37 +02:00
20250805000001-standardize-uid-columns.js Feat: habits (#707) 2025-12-13 08:47:52 +02:00
20250810090000-create-roles.js chore(lint): remove unnecessary try/catch and tighten error handling 2025-09-22 15:20:46 +03:00
20250810090100-create-actions.js chore(lint): remove unnecessary try/catch and tighten error handling 2025-09-22 15:20:46 +03:00
20250810090200-create-permissions.js chore(lint): remove unnecessary try/catch and tighten error handling 2025-09-22 15:20:46 +03:00
20250813103351-add-telegram-allowed-users.js Limit users that can send to telegram bot 2025-08-14 18:00:57 +03:00
20250920074825-add-project-state-column.js Feat/add project states (#354) 2025-09-29 16:04:25 +03:00
20250920075905-convert-active-to-states.js Fix upcoming completed issue (#404) 2025-10-11 00:08:13 +03:00
20250920075916-remove-active-column.js Feat/add project states (#354) 2025-09-29 16:04:25 +03:00
20250924000001-add-uid-to-inbox-items.js Fix notes.js & areas.js UID usage and remove IDs. (#355) 2025-09-29 16:03:46 +03:00
20250925000001-add-uid-to-users.js Fix E2E test breakage (#380) 2025-10-05 16:04:46 +03:00
20251011000001-add-surname-to-users.js Improve migrations safe functions usage 2025-10-14 12:58:30 +03:00
20251014000001-create-views.js Universal search (#412) 2025-10-22 22:00:45 +03:00
20251014202005-add-sidebar-settings-to-users.js Universal search (#412) 2025-10-22 22:00:45 +03:00
20251017000000-add-email-verification-to-users.js Scaffold smtp service (#590) 2025-11-24 17:58:09 +02:00
20251019000000-create-settings.js Scaffold smtp service (#590) 2025-11-24 17:58:09 +02:00
20251020000000-backfill-roles.js Add migration to backfill roles for existing users 2025-10-20 14:43:42 +03:00
20251022000001-add-tags-to-views.js Fix universal search (#445) 2025-10-23 21:43:42 +03:00
20251023000001-add-unique-constraint-tags.js Fix tags migration association 2025-10-28 14:44:10 +02:00
20251106000001-add-color-to-notes.js Notes page revamp! (#487) 2025-11-06 17:59:30 +02:00
20251115000001-create-api-tokens.js API Access (#495) 2025-11-07 15:19:30 +02:00
20251117013905-add-order-to-tasks.js Add migration to fix subtasκ  ordering (#554) 2025-11-17 12:09:31 +02:00
20251118000001-add-recurring-to-views.js Feat add recurring search (#579) 2025-11-18 20:35:50 +02:00
20251119000001-add-recurrence-weekdays.js Fix redesign recurring tasks (#582) 2025-11-19 17:03:26 +02:00
20251120000001-add-ui-settings-to-users.js Tc refactor pt1 (#589) 2025-11-23 21:48:49 +02:00
20251124000001-add-defer-until-to-tasks.js Feat add defer until date (#592) 2025-11-24 21:57:30 +02:00
20251124000002-create-notifications.js Feat notifications (#594) 2025-11-25 21:16:21 +02:00
20251125000001-add-notification-features.js Feat notifications (#594) 2025-11-25 21:16:21 +02:00
20251128000001-create-task-attachments.js Cleanup recurring tasks 2025-12-07 14:12:38 +02:00
20251204000001-add-recurring-completions.js Fix recurring structure (#646) 2025-12-04 13:29:37 +02:00
20251204000002-migrate-recurring-instances.js Fix sql issue (#723) 2025-12-18 15:54:18 +02:00
20251208000001-create-backups-table.js Feat backups (#686) 2025-12-09 08:00:46 +02:00
20251209000001-add-telegram-to-notification-preferences.js Feat telegram notifications (#692) 2025-12-09 20:26:53 +02:00
20251213000001-add-habit-fields.js Feat: habits (#707) 2025-12-13 08:47:52 +02:00
20251215000002-upgrade-inbox-content-field.js Feat add inbox flow (#676) 2025-12-08 09:21:35 +02:00
20251224000001-cleanup-unused-task-fields.js Fix SQLite migration failure when removing uuid column from tasks (#787) 2026-01-22 17:18:01 +02:00
20251227000001-remove-today-column.js Fix bug 733 (#735) 2025-12-27 21:00:52 +02:00
20251228000001-update-project-state-enum.js Fix bug 722 (#737) 2025-12-28 07:51:15 +02:00
20251228000002-rename-project-state-to-status.js Fix failing migration 2026-01-08 00:42:20 +02:00
20251229000001-add-task-performance-indexes.js Fix bug 366 (#764) 2026-01-07 18:18:07 +02:00
20260201000001-add-defer-and-extras-to-views.js Reorder elements (#687) 2025-12-09 10:51:51 +02:00
20260201000002-add-keyboard-shortcuts.js Fix safe function def 2026-01-08 12:07:46 +02:00
20260320000001-add-notification-channel-sent-tracking.js Fix Telegram notification spam with channel-level rate limiting (#951) 2026-03-19 20:26:11 +02:00
20260413000001-ensure-unlimited-text-fields.js fix: prevent task name truncation when creating from inbox (#1020) 2026-04-13 23:14:52 +03:00
20260420000001-create-caldav-calendars.js feat(caldav): Add CalDAV Synchronization Support (Issue #978) (#1030) 2026-04-17 17:40:39 +03:00
20260420000001-create-oidc-identities.js feat: Add OIDC/SSO authentication support (#1008) 2026-04-13 12:17:35 +03:00
20260420000002-create-caldav-sync-state.js feat(caldav): Add CalDAV Synchronization Support (Issue #978) (#1030) 2026-04-17 17:40:39 +03:00
20260420000002-create-oidc-state-nonces.js feat: Add OIDC/SSO authentication support (#1008) 2026-04-13 12:17:35 +03:00
20260420000003-create-auth-audit-log.js feat: Add OIDC/SSO authentication support (#1008) 2026-04-13 12:17:35 +03:00
20260420000003-create-caldav-occurrence-overrides.js feat(caldav): Add CalDAV Synchronization Support (Issue #978) (#1030) 2026-04-17 17:40:39 +03:00
20260420000004-create-caldav-remote-calendars.js feat(caldav): Add CalDAV Synchronization Support (Issue #978) (#1030) 2026-04-17 17:40:39 +03:00
20260420000004-make-password-optional.js fix: make password_digest migration compatible with all schema versions (#1078) 2026-04-26 10:07:55 +03:00
20260420000005-add-caldav-indexes.js feat(caldav): Add CalDAV Synchronization Support (Issue #978) (#1030) 2026-04-17 17:40:39 +03:00