Skip to content

docs(maintenance): runbook for database-only columns after an upgrade; 17.0 __search is a false positive (#528) - #542

Merged
yinlianghui merged 3 commits into
mainfrom
claude/crm-orphan-search-columns-t1vce7
Jul 30, 2026
Merged

yinlianghui merged 3 commits into
mainfrom
claude/crm-orphan-search-columns-t1vce7

Conversation

@yinlianghui

@yinlianghui yinlianghui commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds a §3.1 "Destructive schema drift — database-only columns after an upgrade" section to docs/MAINTENANCE.md, right after the platform-upgrade checklist it extends. os migrate plan can report columns that exist in the database but are not described by any metadata it can see; this section covers how to tell a genuine orphan from a live column the planner simply cannot vouch for, and the safe --allow-destructive procedure for the former.

Important

This PR changed direction after #528 was reclassified. The original version documented the 9 __search columns as orphans and walked operators through dropping them. Column-level verification (recorded in #528) showed they are live pinyin search-companion columns provisioned by the dev runtime — the database built by objectstack dev has 34 columns on crm_task including __search, the one built by os migrate plan --database-url <new file> has 33 without it, and migrate reports 0 destructive changes against the database it built itself. The report is a schema-view mismatch between the migrate CLI and the dev runtime, filed upstream as objectstack#3955.

Following the original runbook would have dropped working search columns, and its own safety check would not have caught it: the section named those exact columns as expected-to-drop, so "is this a column backing a field you still declare?" cleared them. The section now records the __search class as a known false positive — do not touch until #3955 lands, and the plan-review step gained a second test (is this a runtime-provisioned companion column?) plus a concrete proof technique (diff the plan against a freshly created database from the same artifact).

The cleanup itself is a runtime operation run against each deployed database during a maintenance window, so the repo deliverable is the runbook, not a code change.

Sourcing note. #528 points at docs/upgrade-17/test-report.md on branch upgrade/objectstack-17. That branch exists on this remote and is deliberately kept PR-less — it carries only the 17.0 adaptation and is blocked on 17.0 GA plus objectstack#3912/#3913/#3914. Its report records the count but does not itemise the columns, so the section names the five objects from the issue and defers to each database's own os migrate plan output.

Scope note. This is the one item from the 17.0-rc test round that is not a pre-existing 16.x defect — it only appears after a database has been upgraded to 17.0. It is merged ahead of the upgrade so the procedure (and the warning) are in place when it lands. Documentation only; changes no application behaviour.

Type of Change

  • Documentation

Checklist

  • Documentation updated (docs/MAINTENANCE.md)
  • Changeset added (empty frontmatter — releases nothing)
  • No application code touched

Refs #528 — the issue stays open, blocked on
objectstack#3955.

…7.0 (#528)

ObjectStack 17.0 tightened the conditions under which full-text __search
companion columns are provisioned, leaving 9 orphan columns in databases
that lived through <=16.x (crm_competitor, crm_opportunity_line_item,
crm_quote_line_item, crm_task, sys_metadata, among others). The cleanup
itself is a runtime operation (os migrate apply --allow-destructive) that
must run against each deployed database, so the repo deliverable is the
runbook: a new "Destructive schema drift" section in docs/MAINTENANCE.md
documenting when os migrate plan reports database-only columns, the known
17.0 __search case, and the safe apply procedure (stop the service per
platform issue #526, back up, review the plan, apply, verify).

Closes #528

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UR21JtWgnthiiQKBHwKpJX
@vercel

vercel Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Jul 30, 2026 9:37am

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 29, 2026
… known false positive

Issue #528 was reclassified after column-level verification: the 9 database-only
`__search` columns are live pinyin search-companion columns provisioned by the
dev runtime, not orphans. `os migrate plan` misreports them because the CLI's
schema view differs from the running server's (upstream objectstack#3955), so
the original runbook would have talked operators into dropping working search
columns — and its own safety check could not catch it, since the section named
those columns as expected-to-drop.

Section 3.1 now leads with the distinction (genuine orphan vs planner-invisible
live column), records the __search class as a do-not-touch false positive until
#3955 lands, and hardens the plan-review step with a second test plus a concrete
proof technique (diff against a freshly created database from the same artifact).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@yinlianghui yinlianghui changed the title docs(maintenance): runbook for orphan __search column cleanup after 17.0 (#528) docs(maintenance): runbook for database-only columns after an upgrade; 17.0 __search is a false positive (#528) Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

CI red on Build and Test (22.x) — the failure is on the base branch, not this PR.

objectstack validate fails on current main (7f0b3ef) with the same 4 errors CI shows here:

✗ Permission 'marketing_user' grants on object 'crm_competitor' which is not defined in objects.
✗ Permission 'sales_manager' grants on object 'crm_competitor' which is not defined in objects.
✗ Permission 'sales_rep' grants on object 'crm_competitor' which is not defined in objects.
✗ Permission 'system_admin' grants on object 'crm_competitor' which is not defined in objects.

Root cause is a semantic conflict between two of today's merges:

Neither PR conflicted textually, so both merged green, but their combination leaves main granting on an object that no longer exists. Every PR's merge-ref CI now inherits the failure — this PR is markdown-only and validates green standalone (verified on the exact head commit, including under CI's Node 22.23.1). The fix belongs on main: drop the stale crm_competitor grants from the four profiles (or restore the object, if the removal wasn't meant to outlive #547).

Will merge main into this branch and re-run CI once the base is green.


Generated by Claude Code

@yinlianghui
yinlianghui marked this pull request as ready for review July 30, 2026 10:04
@yinlianghui
yinlianghui merged commit 2f8ee54 into main Jul 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants