Skip to content

Conversation

@melroy89
Copy link
Member

@melroy89 melroy89 commented Nov 21, 2025

While we did upgrade symfony to v7.3. But we didn't upgrade the symfony/orm-pack stack in Mbin. So I started to upgrade the ORM pack, see also: https://symfony.com/doc/current/doctrine.html#installing-doctrine

Then the file EnumType.php failed with errors (where previously deprecations), which I then also fixed..

Also array is no longer a valid ORN database type: https://www.doctrine-project.org/projects/doctrine-dbal/en/stable/reference/types.html#array-types
So I moved from array to json type.

@melroy89 melroy89 added bug Something isn't working backend Backend related issues and pull requests high priority critical issue or PR that impacts production labels Nov 21, 2025
@melroy89

This comment was marked as outdated.

@melroy89

This comment was marked as outdated.

@blued-gear
Copy link
Collaborator

According to this there are new types for arrays. But they use string-join (imploding) or JSON.
As one occurrence looks like a many-to-many relation, Collections (and join columns) should be used: www 1, www 2.

@melroy89
Copy link
Member Author

I guess they forgot to update this docs page: https://doctrine-dbal-rtd.readthedocs.io/en/latest/reference/types.html#array ..

@melroy89
Copy link
Member Author

melroy89 commented Nov 21, 2025

We can I think just update this type to json I believe. Just like we how we use it with preferredLanguages

This is how this featuredMagazines gets converted to PostgreSQL .. just for info!

image

@melroy89

This comment was marked as off-topic.

@blued-gear
Copy link
Collaborator

This is how this featuredMagazines gets converted to PostgreSQL .. just for info!

But what is the text content of one row?

@melroy89

This comment was marked as off-topic.

@melroy89
Copy link
Member Author

melroy89 commented Nov 21, 2025

This is how this featuredMagazines gets converted to PostgreSQL .. just for info!

But what is the text content of one row?

Well since its now a text field. it just looks like this:

image

Only 5 users of the 270 million user rows have this filled in (on my server). But clearly kbin.social is down for years, so its not activity used either.

@melroy89 melroy89 changed the title Fix invalid composer doctrine versions Upgrade the symfony or pack Nov 21, 2025
@melroy89 melroy89 added dependencies Pull requests that update a dependency file and removed bug Something isn't working high priority critical issue or PR that impacts production labels Nov 21, 2025
@melroy89 melroy89 changed the title Upgrade the symfony or pack Upgrade the symfony ORM pack Nov 21, 2025
@melroy89
Copy link
Member Author

melroy89 commented Nov 21, 2025

migration diff command now gives me the following error:

 php bin/console doctrine:migrations:diff
[2025-11-21T19:24:06.420126+00:00] doctrine.INFO: Connecting with parameters array{"use_savepoints":true,"driver":"pdo_pgsql","idle_connection_ttl":600,"host":"127.0.0.1","port":5432,"user":"mbin","password":"<redacted>","driverOptions":[],"defaultTableOptions":[],"dbname":"mbin","serverVersion":"16","charset":"utf8"} {"params":{"use_savepoints":true,"driver":"pdo_pgsql","idle_connection_ttl":600,"host":"127.0.0.1","port":5432,"user":"mbin","password":"<redacted>","driverOptions":[],"defaultTableOptions":[],"dbname":"mbin","serverVersion":"16","charset":"utf8"}} []
[2025-11-21T19:24:06.518905+00:00] console.CRITICAL: Error thrown while running command "doctrine:migrations:diff". Message: "The namespace with name "public" already exists." {"exception":"[object] (Doctrine\\DBAL\\Schema\\Exception\\NamespaceAlreadyExists(code: 0): The namespace with name \"public\" already exists. at /home/melroy/Documents/projects/mbin/vendor/doctrine/dbal/src/Schema/Exception/NamespaceAlreadyExists.php:16)","command":"doctrine:migrations:diff","message":"The namespace with name \"public\" already exists."} []

In NamespaceAlreadyExists.php line 16:
                                                    
  The namespace with name "public" already exists.  
                                                    
doctrine:migrations:diff [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--namespace NAMESPACE] [--filter-expression FILTER-EXPRESSION] [--formatted] [--nowdoc|--no-nowdoc] [--line-length LINE-LENGTH] [--check-database-platform [CHECK-DATABASE-PLATFORM]] [--allow-empty-diff] [--from-empty-schema]

Related? doctrine/migrations#1476

@melroy89
Copy link
Member Author

migration diff command now gives me the following error:

 php bin/console doctrine:migrations:diff
[2025-11-21T19:24:06.420126+00:00] doctrine.INFO: Connecting with parameters array{"use_savepoints":true,"driver":"pdo_pgsql","idle_connection_ttl":600,"host":"127.0.0.1","port":5432,"user":"mbin","password":"<redacted>","driverOptions":[],"defaultTableOptions":[],"dbname":"mbin","serverVersion":"16","charset":"utf8"} {"params":{"use_savepoints":true,"driver":"pdo_pgsql","idle_connection_ttl":600,"host":"127.0.0.1","port":5432,"user":"mbin","password":"<redacted>","driverOptions":[],"defaultTableOptions":[],"dbname":"mbin","serverVersion":"16","charset":"utf8"}} []
[2025-11-21T19:24:06.518905+00:00] console.CRITICAL: Error thrown while running command "doctrine:migrations:diff". Message: "The namespace with name "public" already exists." {"exception":"[object] (Doctrine\\DBAL\\Schema\\Exception\\NamespaceAlreadyExists(code: 0): The namespace with name \"public\" already exists. at /home/melroy/Documents/projects/mbin/vendor/doctrine/dbal/src/Schema/Exception/NamespaceAlreadyExists.php:16)","command":"doctrine:migrations:diff","message":"The namespace with name \"public\" already exists."} []

In NamespaceAlreadyExists.php line 16:
                                                    
  The namespace with name "public" already exists.  
                                                    
doctrine:migrations:diff [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--namespace NAMESPACE] [--filter-expression FILTER-EXPRESSION] [--formatted] [--nowdoc|--no-nowdoc] [--line-length LINE-LENGTH] [--check-database-platform [CHECK-DATABASE-PLATFORM]] [--allow-empty-diff] [--from-empty-schema]

Related? doctrine/migrations#1476

OK I removed the src/EventListener/DoctrineMigrationsListener.php file.

@melroy89 melroy89 added the low priority does not impact production code label Nov 21, 2025
@melroy89 melroy89 marked this pull request as draft December 3, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend related issues and pull requests dependencies Pull requests that update a dependency file low priority does not impact production code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants