Skip to content

17.6.0: os migrate meta --stored (preview) and os migrate audit-metadata-bodies (dry run) boot the app's seed loader and write to application tables #21349

Description

@hotlong

Summary

On 17.6.0, two commands documented as read-only previews write to the application's tables:

  • os migrate meta --stored without --apply;
  • os migrate audit-metadata-bodies without --apply (new in 17.6.0).

Both boot the app's seed loader against the target database. It rewrites seeded rows, and it logs an error when it tries to write to a view. The 17.5.0 CLI, run on the same file, changes nothing. So for --stored this is a 17.6.0 regression.

The 17.6.0 upgrade checklist tells every operator to run both commands first as previews:

  • os migrate meta --stored, then --stored --apply;
  • os migrate audit-metadata-bodies ("a dry run by default"), then --apply.

The preview should leave the database unchanged.

Found by the HotCRM 17.6.0 upgrade lane of the 17.6.0 release verification (objectstack-ai/hotcrm#1982, "Platform issues → A"). That session could not attach this repository, so it is filed from the release session.

Steps

  1. Create a SQLite database with HotCRM on 17.5.0: boot it, let the seed load run, and sign up the first admin. Copy the file.
  2. With @objectstack/cli@17.6.0, run os migrate meta --stored --database-url file:<copy>. Do not pass --apply.
  3. Compare row hashes of the app tables before and after. Do the same for os migrate audit-metadata-bodies --database-url file:<copy> without --apply.

Expected

A read-only preview: the file is unchanged.

Actual

The command boots the app's seed loader. On crm_contact, crm_lead, crm_opportunity and five more tables it:

  • bumps updated_at;
  • stamps organization_id on seeded rows that had none;
  • rewrites relative-date seed values.

It also logs ERROR [SeedLoader] Failed to write sys_activity …: cannot modify sys_activity because it is a view, because sys_activity is a rotation view on that database.

Comparison

  • The 17.5.0 CLI, running os migrate meta --stored on the same file, leaves every row hash identical and logs no SeedLoader error.
  • audit-metadata-bodies is new in 17.6.0, so it has no 17.5.0 baseline. Its dry run makes the same writes.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratebugSomething isn't workingdomain:clipriority:p1High: required for production / M2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions