-
-
Notifications
You must be signed in to change notification settings - Fork 544
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
Schema Generator touches nullable properties with each update #491
Comments
Well it does not produce any additional queries for me. What version of MySQL are you using (not the driver)? Maybe you use MySQL 8? edit: it works ok for me even with MySQL 8. also tried to run it in the repo you provided, same result. |
Hi, thanks for your reply. I am using MariaDB, Edit: I just tested it with MySQL 8.0.19 as server, I am getting the same result as you did (everything works as it should). |
Interesting, tried it with mariadb 10.1 first and it passed, but with 10.4 it does behave like you described. |
Describe the bug
When generating a migration or running a schema upgrade directly, the schema generator alters the nullable properties of the entity each time.
Stack trace
The generated schema update is the following (even if executed already):
To Reproduce
I've created a sample repository. Use
ts-node src/main.ts
to run.https://github.com/jasperroloff/mikro-orm-nullable-issue
Expected behavior
Since the entity didn't change, the schema generator should generate an empty update (without the "alter table ..." statements).
Additional context
I discovered this behavior with both metadata providers: TsMorph, ReflectMetadata and with both database drivers: mysql, mariadb.
Versions
(see package.json in sample repo)
The text was updated successfully, but these errors were encountered: