V6.0.0 Upgrade- Error when creating or editing forms

Hi Team,
We have upgraded to mautic 6.0.0, previous version the latest in v5 series.
PHP 8.2.x

When we try to access forms, editing, we get this error.

[2025-03-27T11:06:35.248493+00:00] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.is_read_only' in 'SELECT'" at /home/abmovers/webapps/go300/public/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 67 {"exception":"[object] (Doctrine\\DBAL\\Exception\\InvalidFieldNameException(code: 1054): An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.is_read_only' in 'SELECT' at /home/abmovers/webapps/go300/public/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:67)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1054): SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.is_read_only' in 'SELECT' at /home/abmovers/webapps/go300/public/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.is_read_only' in 'SELECT' at /home/abmovers/webapps/go300/public/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130)"} {"hostname":"xxxxxx.xxxxxxx.net","pid":2913924}

There has been no issue with db migrations - everything is present.

Any idea what the issue is.
Matthew

Hi Matthew,

When you did the install, did you run all the required migrations?

Specifically, this is the migration for creating that table field:

app/migrations/Version20241227065658.php

@rcheesley Yes we did…Is it possible to run that manually ? If yes how.
Matthew

@rcheesley I ran this command manually on the database and it fixed the issue. Thanks for the info.

ALTER TABLE form_fields
ADD COLUMN is_read_only TINYINT(1) DEFAULT 0;

or direct cli command

php bin/console doctrine:migrations:migrate “Mautic\Migrations\Version20241227065658” --env=prod

@rcheesley I just ran the migrations and it does not run the one you have listed. It would be helpful to know this and understand these migrations to the database in more detail. Even perhaps mentioning this in the update info when a release is set.
Offering an alternate way of doing this would also be useful

How do you run an individual migration?
Matthew

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.

ChatGPT to the rescue (always be sure to back up your database first, of course!)

To run an individual Doctrine migration, you can use the Doctrine Migrations library which provides a command-line tool to execute specific migrations. Here’s how you can run an individual migration:

  1. Locate the Migration Version: First, identify the version number of the migration you want to execute. Migration files are typically named with a version number at the beginning, for example, Version20230401123456.php.

  2. Use the Doctrine Command: Use the following command to execute a specific migration:

php bin/console doctrine:migrations:execute ‘Version20230401123456’ --up

Replace ‘Version20230401123456’ with the actual version number of the migration you wish to run.

:black_small_square: --up is used to apply the migration.

:black_small_square: If you need to revert a migration, you can use --down instead of --up.

  1. Check for Errors: After running the command, check the output for any errors or confirmations that the migration has run successfully.

Make sure you have the correct permissions and that your database connection settings are correctly configured before running migrations. Additionally, it’s a good practice to backup your database before performing migrations, especially in a production environment.