-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symfony 6 / Doctrine / Migration: [ERROR] The database schema is not in sync with the current mapping file #6091
Comments
StackOverflow is a good place for your kind of question. Alternatively, you could also try to ask for help on https://github.com/doctrine/orm/discussions/. This issue tracker however is used for bug reports and feature request, which is why I'm closing your issue. I've read your write-up on StackOverflow however, but I don't really know why the schema validation fails in your case. My best guess would be that the old MariaDB version on your prod system behaves a bit differently than the fairly recent version on your dev system. But that's a shot in the dark. 😕 |
Thanks @derrabus. |
I don't fully understand what you mean by this. How do you know which platform the DBAL uses internally when using this or that command?
Why are you using different versions of MariaDB? Isn't that looking for trouble? |
Hello, @greg0ire. And yes, you are correct. That was a dumb decision I now regret, but I'm fairly new and did not consider this to be a huge problem in the first place, since the documentation states that all MariaDB versions up from version 10.2. are supported. |
Might be cool to use |
Thanks @greg0ire :) But unfortunately that brought the same results. Now I wonder why Also when I run
I can't read anything different than already reflected in my entities. |
Even after dropping the schema entirely and creating a new one, it's still validating as not in sync with the current mapping file. That normally should not be the case, right?! Any ideas what this could cause? |
I think you're misunderstanding what this command does. Please confirm that doctrine/migrations#1339 helps. |
Before looking into that, I would try to make sure the same platform is detected on all envs. Until that is fixed, there is little point running other commands and getting more confused
prod, as well, right? Here is the line from which the platform is obtained: https://github.com/doctrine/migrations/blob/478fd2f2739fd3fd732b83eb729a51e7b32c2b99/lib/Doctrine/Migrations/DependencyFactory.php#L424 |
Yes, that would very much help. I found little documentation about this and ended up asking ChatGPT 🤣
Prod and staging are on the same server, so yes.
I will dig further into this. Thanks a lot for your help! :) |
Yep, so for whatever reason it seems to think that my prod / staging platform is of class MySQLPlatform. I put in a
|
Do you reproduce that behavior in |
Just did and it's showing me MariaDBPlatform with the staging settings on dev as well. Of course I changed the credentials to the local DB. |
I'm curious whether you enter this if block or not: Lines 316 to 317 in 1c462ee
I want to make sure that the |
Oh, good point. I actually get into this block on ALL three envs. So platform is null every time. |
Ok well… debug further… what's the value of Line 172 in 1c462ee
|
The DriverManager seems to get the correct params in all three environments: $params = [
"dbname" => "<mydbname>"
"host" => "127.0.0.1"
"user" => "<mydbuser>"
"password" => "<mydbpw>"
"charset" => "utf8mb4"
"driver" => "pdo_mysql"
"port" => null
"driverOptions" => array:1 [
"platform" => "mariadb"
]
"serverVersion" => "mariadb-11.0.2"
"defaultTableOptions" => []
]; The result is coming from the argument passed and also when it's parsed. |
@henritielscher I'm sorry, apparently this blog is supposed to always be entered: Lines 316 to 317 in 1c462ee
What's import to determine is whether this one is: Lines 438 to 441 in 1c462ee
If it is, this is the piece of code you will want to debug: dbal/src/Driver/AbstractMySQLDriver.php Lines 34 to 78 in 1c462ee
|
Thanks again for your help. I really appreciate that someone can help me with this :) |
And what is the class of |
Sorry, I actually looked that up and totally forgot to mention... In staging it is: Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverForV32 I will hopefully manage to get into this asap. |
Interesting. If you run |
Ok, I finally had time to work on the project again, and f**k it really was the Sentry library that needed an update. Sentry is turned off on development, hence I didn't notice. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hey there I described my issue in Stack Overflow HERE in detail. I hope it is fine to not write it down again...
I use the dbal version 3.6.3
Huge thanks in advance and please let me know if this is helpful enough to determine the problem...
I'm going insane over this and have no idea where to get further informations :(
The text was updated successfully, but these errors were encountered: