Skip to content

👷 build(db): add tasks.editor_data column for Task rich-editor round-trip#15239

Closed
sudongyuer wants to merge 1 commit into
canaryfrom
sudongyuer/db-tasks-editor-data
Closed

👷 build(db): add tasks.editor_data column for Task rich-editor round-trip#15239
sudongyuer wants to merge 1 commit into
canaryfrom
sudongyuer/db-tasks-editor-data

Conversation

@sudongyuer

Copy link
Copy Markdown
Collaborator

Summary

Adds the editor_data jsonb column on the tasks table so the Task instruction editor can persist its Lexical state — image sizes, custom nodes, and other rich attributes that the markdown column drops.

Required by LOBE-8967 (Task attachment / image upload support, see #15141). Split out per the project's version-release skill Scenario 4: DB Schema Migration — schema changes ship in their own PR with a dedicated changelog so the cherry-pick onto main stays clean for self-hosted users.

Migration

ALTER TABLE "tasks" ADD COLUMN IF NOT EXISTS "editor_data" jsonb;
  • Scope: 1 nullable column added to tasks
  • Backwards compatible: yes — column is nullable, existing rows unaffected
  • Self-hosted action: none — migration runs automatically on app startup
  • Rollback: standard DB restore policy; column drop is non-destructive (nullable, additive)

task_comments.editor_data already exists on canary from the original 0095 task system migration; only tasks needed this column.

Why a separate PR

Per .agents/skills/version-release/references/patch-release-scenarios.md § 4, DB schema changes are released independently from feature code so the migration commit can be cherry-picked cleanly into a release/db-migration-* branch for the canary → main release. Bundling schema with feature code would make that cherry-pick messy.

Feature PR that depends on this column: #15141 (LOBE-8967 Task attachment upload). Once this merges, #15141 will rebase on canary.

Related

Test plan

  • bun run db:generate regenerates a clean migration
  • migration SQL is idempotent (ADD COLUMN IF NOT EXISTS)
  • schema snapshot + journal consistent
  • no other table touched

🤖 Generated with Claude Code

…trip

Adds the `editor_data jsonb` column on `tasks` so the Task instruction
editor can persist its Lexical state — image sizes, custom nodes, and
other rich attributes that markdown drops. Required by LOBE-8967.

`task_comments.editor_data` already exists on canary from the original
0095 task system migration; only `tasks` needed this.

Migration: ALTER TABLE "tasks" ADD COLUMN IF NOT EXISTS "editor_data" jsonb

Backwards compatible — column is nullable, existing rows unaffected.
Self-hosted users: migration runs automatically on app startup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: lobehub.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 26, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @sudongyuer, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.84%. Comparing base (5f27cd8) to head (af34c42).
⚠️ Report is 3 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff            @@
##           canary   #15239     +/-   ##
=========================================
  Coverage   70.84%   70.84%             
=========================================
  Files        3160     3160             
  Lines      315544   315568     +24     
  Branches    27765    34400   +6635     
=========================================
+ Hits       223554   223571     +17     
- Misses      91821    91828      +7     
  Partials      169      169             
Flag Coverage Δ
app 61.72% <ø> (+<0.01%) ⬆️
database 92.22% <ø> (ø)
packages/agent-runtime 80.48% <ø> (ø)
packages/builtin-tool-lobe-agent 19.87% <ø> (ø)
packages/context-engine 84.13% <ø> (ø)
packages/conversation-flow 91.28% <ø> (ø)
packages/file-loaders 87.89% <ø> (ø)
packages/memory-user-memory 74.99% <ø> (ø)
packages/model-bank 99.99% <ø> (ø)
packages/model-runtime 83.90% <ø> (ø)
packages/prompts 72.67% <ø> (+<0.01%) ⬆️
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/types 35.07% <ø> (ø)
packages/utils 88.47% <ø> (ø)
packages/web-crawler 88.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 67.71% <ø> (ø)
Services 54.64% <ø> (ø)
Server 72.25% <100.00%> (+<0.01%) ⬆️
Libs 56.97% <ø> (ø)
Utils 85.96% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sudongyuer

Copy link
Copy Markdown
Collaborator Author

Merged into #15186 — that PR now bundles both DB schema additions (push_tokens table + tasks.editor_data column) since they're both schema-only changes that get cherry-picked into the same release/db-migration-* window.

The tasks.editor_data migration is now 0105_add_tasks_editor_data.sql on the combined branch (since 0104 is taken by push_tokens).

Feature PR #15141 (LOBE-8967) now depends on #15186 instead of this PR.

@sudongyuer sudongyuer closed this May 26, 2026
@sudongyuer sudongyuer deleted the sudongyuer/db-tasks-editor-data branch May 26, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant