Skip to content

Preserve external MySQL database names - #4690

Open
atirna wants to merge 9 commits into
Automattic:trunkfrom
atirna:fix/preserve-external-mysql-db-name
Open

Preserve external MySQL database names#4690
atirna wants to merge 9 commits into
Automattic:trunkfrom
atirna:fix/preserve-external-mysql-db-name

Conversation

@atirna

@atirna atirna commented Aug 26, 2026

Copy link
Copy Markdown

Related issues

How AI was used in this PR

Used AI assistance while investigating and implementing this fix. I reviewed and own the patch.

Proposed Changes

  • Uses the site's SQLite integration state to decide whether Studio owns DB_NAME.
  • Sets DB_NAME to wordpress for SQLite sites, including empty, dynamic, or duplicate definitions.
  • Leaves all DB_NAME definitions untouched for external MySQL sites.

Testing Instructions

  • npm test -- apps/cli/lib/native-php/tests/site-setup.test.ts (10 passed)
  • npx prettier --check apps/cli/lib/native-php/site-setup.ts apps/cli/lib/native-php/tests/site-setup.test.ts apps/cli/lib/import-export/import/importers/importer.ts
  • npx eslint apps/cli/lib/native-php/site-setup.ts apps/cli/lib/native-php/tests/site-setup.test.ts apps/cli/lib/import-export/import/importers/importer.ts apps/cli/php/wp-config-transformer.php
  • php -l apps/cli/php/wp-config-transformer.php

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

Comment thread apps/cli/lib/native-php/site-setup.ts Outdated
Comment thread apps/cli/php/wp-config-transformer.php Outdated

@gavande1 gavande1 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.

Thank you @atirna for opening this and for digging into the root cause. I have left a few comments inline, mostly around the edge cases for the preserved value.

@gavande1

Copy link
Copy Markdown
Contributor

Thanks, @atirna, for addressing the feedback. I will take a look shortly.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native PHP runtime forces external MySQL database name to wordpress

2 participants