Skip to content

Fix incorrect claim that Strapi deletes unknown database tables - #3421

Merged
pwizla merged 6 commits into
mainfrom
cms/fix-database-migrations-table-deletion
Aug 28, 2026
Merged

Fix incorrect claim that Strapi deletes unknown database tables#3421
pwizla merged 6 commits into
mainfrom
cms/fix-database-migrations-table-deletion

Conversation

@pwizla

@pwizla pwizla commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

This PR corrects the database migrations page, which stated that Strapi deletes any unknown table without warning. The schema sync only drops the tables, columns, indexes, and foreign keys that Strapi previously managed, and tables created outside of Strapi are explicitly left untouched. It also adds a step-by-step startup sequence, since the destructive step was previously buried in a warning callout, and clarifies forceMigration (which controls destructive schema operations rather than migrations), runMigrations, and useTypescriptMigrations, which was referenced from the migrations page but missing from the settings table.

It also fixes a few pre-existing problems found on both pages while reviewing the change:

  • Corrects the forceMigration guidance, which presented false as a dry-run to inspect what would be dropped. The schema sync records the new schema as the reference regardless, so a skipped object simply stops being tracked.
  • Fixes a syntax error in the TypeScript configuration example, which opened with export default = ({ env }) =>.
  • Uses the PostgreSQL port 5432 instead of the MySQL port 3306 in the postgres branch of both generated-configuration examples.
  • Replaces the deprecated Entity Service with the Document Service in the migration example.
  • Rewrites the migration progress heartbeats section, whose sample output was missing the prefix the logger always emits and which implied the heartbeats were available to user migration files, when the logger is only used by Strapi's internal migrations.

Comes from docs feedback CMS-260730060248, where a user reported having to read the source code to understand what the migration process actually does to their tables.

Direct preview link 👉 here

pwizla added 2 commits August 28, 2026 11:49
The schema sync only drops tables and columns that Strapi previously managed; tables created outside of Strapi are explicitly left untouched. Also documents the startup sequence, since the destructive step was buried in a warning callout.
forceMigration controls destructive schema operations rather than migrations, which the previous one-line description did not convey. useTypescriptMigrations was referenced from the migrations page but missing from this table.
@pwizla pwizla self-assigned this Aug 28, 2026
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview Aug 28, 2026 12:40pm

Request Review

@github-actions github-actions Bot added internal PRs created by the Strapi core team pr: updated content PRs updating existing documentation content source: CMS labels Aug 28, 2026
pwizla added 2 commits August 28, 2026 14:32
…ages

The migrations page presented forceMigration: false as a dry-run to inspect what would be dropped, but the schema sync persists the new schema regardless, so a skipped object stops being tracked. It also credited runMigrations with fine-tuning the schema sync, which it does not affect. Aligns the drop scope on tables, columns, indexes, and foreign keys, and uses schema sync rather than schema migrations.
Each numbered step now describes one action, per the technical writing rules, and bold is reserved for UI elements. Also downgrades an informational callout from caution to note.
pwizla added 2 commits August 28, 2026 14:38
… pages

The TypeScript configuration example opened with 'export default =', which is a syntax error, and both generated-configuration blocks used the MySQL port 3306 in their postgres branch instead of 5432. The migration example also used the deprecated Entity Service instead of the Document Service.
The sample output was missing the prefix that the logger always emits, and the section implied the heartbeats were available to user migration files. The logger is not exported from the database package and is only used by Strapi's internal migrations, so the section now explains how to read the log line instead.

@pwizla pwizla left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

LGTM

@pwizla pwizla added this to the 7.1.1 milestone Aug 28, 2026
@pwizla
pwizla merged commit a4f3788 into main Aug 28, 2026
5 checks passed
@pwizla
pwizla deleted the cms/fix-database-migrations-table-deletion branch August 28, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-users-feedback internal PRs created by the Strapi core team pr: updated content PRs updating existing documentation content source: CMS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant