fix: add missing data column to user_profiles migration#755
Merged
Conversation
The user edit page (/admin/users/:id/edit) crashes with a 500 error because the user_profiles table is missing the `data` column. PR #747 added code querying this column but placed the migration in the wrong directory (src/db/migrations/ instead of migrations/), so it was never bundled or executed. - Add data column to migration 032 CREATE TABLE (fresh installs) - Add migration 035 ALTER TABLE for existing databases - Add data column to app-level migration 018 - Remove misplaced 0011_user_profiles_data.sql - Regenerate migrations bundle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/admin/users/:id/edit) crashes with a 500 error because theuser_profilestable is missing thedatacolumnSELECT ... data FROM user_profilesbut placed the migration file in the wrong directory (src/db/migrations/instead ofmigrations/), so it was never bundled or executedChanges
packages/core/migrations/032_user_profiles.sqldata TEXT DEFAULT '{}'to CREATE TABLEpackages/core/migrations/035_user_profiles_data_column.sqlpackages/core/src/db/migrations-bundle.tsmy-sonicjs-app/migrations/018_user_profiles.sqldatacolumn for app-level consistencypackages/core/src/db/migrations/0011_user_profiles_data.sqlRoot Cause
PR #747 (configurable user profile fields plugin) introduced a migration file
0011_user_profiles_data.sqlinpackages/core/src/db/migrations/. However, the migration generator script (scripts/generate-migrations.ts) reads frompackages/core/migrations/. The migration was never bundled, so thedatacolumn was never created, causing the user edit page to crash when it queries that column.Testing
tsc --noEmit)Checklist
38-user-profile-edit.spec.tscovers this page🤖 Generated with Claude Code