Skip to content

Conversation

@cibero42
Copy link
Contributor

This PR fixes #437, which was a bug introduced on #434, when trying to improve the upgrading process of the image.

Now migrations should only be ran when the container detects that Mautic is already installed, meaning, when local.php contains parameters['site_url']

@cibero42 cibero42 requested a review from a team August 12, 2025 12:20
@cibero42 cibero42 closed this Aug 12, 2025
@cibero42 cibero42 reopened this Aug 12, 2025
@escopecz escopecz requested a review from Copilot August 12, 2025 14:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where database migrations were running on clean Mautic installations, which could cause issues during the initial setup process. The fix adds a check to determine if Mautic is already installed before running migrations.

  • Adds conditional logic to only run migrations when Mautic is already installed
  • Introduces logging to track when migrations are run or skipped
  • Uses the presence of site_url parameter in local.php as the installation indicator

@cibero42
Copy link
Contributor Author

@mautic/docker-maintainers could you please review this one? It's a blocker for 7.0.0-alpha

@RCheesley
Copy link
Member

@O-Mutt @matbcvo would you be able to take a look and review this PR please? Thank you!

@cibero42 cibero42 requested review from O-Mutt and matbcvo August 14, 2025 13:57
cibero42 and others added 3 commits August 15, 2025 11:36
Co-authored-by: Martin Vooremäe <martin.vooremae@gmail.com>
Co-authored-by: Martin Vooremäe <martin.vooremae@gmail.com>
@cibero42 cibero42 requested a review from matbcvo August 15, 2025 09:48
@cibero42
Copy link
Contributor Author

Pipelines are going to fail. See #441

@cibero42 cibero42 changed the title [Fix] Running Migrations On Clean Installs fix: Running Migrations On Clean Installs Aug 15, 2025
@cibero42 cibero42 merged commit 4ea00c2 into mautic:mautic5 Aug 15, 2025
1 of 3 checks passed
@cibero42 cibero42 deleted the fix-437 branch August 15, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Fresh install start migrating instead of creating tables

3 participants