Skip to content
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

fix(core): use schemaGenerator option disableForeignKeys when dropping database #3007

Conversation

luksiv
Copy link

@luksiv luksiv commented Apr 12, 2022

closes #3004

@luksiv
Copy link
Author

luksiv commented Apr 13, 2022

@B4nan could you re-trigger tests, because yesterday Github Actions were down.

@B4nan
Copy link
Member

B4nan commented Apr 13, 2022

Well, the tests ran, and timed out after 6 hours because of one broken assertion that caused the tests to hang (as no orm.close() was called as the test failed). This is something to be fixed, rerunning the tests won't help. There are test failures in tests/features/schema-generator/SchemaGenerator.mysql2.test.ts because of this change, and maybe elsewhere too.

The problem is in circular FK between author2 and book2 tables (and probably other similar issues in other relations), I believe we actually need to disable the FK checks for this use case in mysql (dropping tables). The alternative would be to first drop the FKs, which actually sounds quite reasonable, but should be rather a separate PR.

@luksiv
Copy link
Author

luksiv commented Apr 13, 2022

If you can try to resolve this, I would really appreciate it, since this is a little bit too advanced for me to try to do without pouring a lot of hours into trying to fix this 😄

@B4nan
Copy link
Member

B4nan commented Apr 13, 2022

Yeah sure, it should be rather easy, I can look into that myself when I find some spare time.

@B4nan
Copy link
Member

B4nan commented Apr 13, 2022

I ended up taking a bit different approach as the default was not needed in dropSchema, should be resolved via b1b5f55

@B4nan B4nan closed this Apr 13, 2022
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.

CLI command "fresh" fails to execute when disableForeignKeys is set to false
2 participants