-
-
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
Restore foreign keys and add constraints #1562
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me, I'll let @juanfont have the last say since he did the change, but I recon it would be hard to remember.
Hi, I'm had some other work the previous weeks and I'm on holiday this week but hope to get back to the last things next week. |
Hey @kradalby, could you check this out? I just resolved conflicts, and it seems like the tests are running smoothly now. |
I think this looks reasonable, I'm running the tests now. Are there any potential concerns we should think of that might not be covered by the current tests? |
@kradalby , I couldn't think of any potential issues that might arise with this, and for which there are no tests already in place, the changes seem fairly safe. |
@kradalby, I see that all tests passed except TestAuthKeyLogoutAndRelogin, which failed with the error:
and
From what I understand, there seems to be an issue with DERP. Overall, is this test stable? Is there a chance that this instability is due to infrastructure issues with the tests, or is the test error caused by my changes specifically? Should I investigate further to find the root cause? |
I'm seeing that particular test fail on one of my PRs too, but not locally, not sure what is up. |
So, can this PR be merged? If yes, let's do it please, to prevent future conflicts. |
@kradalby, I found the reason why it works locally for you but not in pipelines. The issue lies in something broken in the Docker image of tailscale It might be worth reporting this in the issues section of tailscale. Since you're presumably affiliated with the tailscale team, perhaps you could inform them about this issue, as I don't have a full understanding of the reasons to describe the issue accurately. Here's a snippet from the contents of
I've also included a commit with a fix that adjusts the makefile command to run integration tests: 18bd635 |
I have not had too much time to look into it, but after clearing the cache I can confirm this behaviour, however, I dont get why I dont see it with any of the other tests because they have the same assertion. |
What I find odd is that it all the other tests pass, and those two consistently fail. I've poked around in the tailscale client code and it doesnt seem like there is any change that should affect this. |
I went through the versions of Tailscale and managed to find the version with the issue, |
I'll take a look, thanks, since it is not related to this PR, I will merge it for now. |
Hello there,
This pull request addresses the issue #1482, aiming to fix the anomalies regarding foreign keys and constraints in database models. Initially FK was disabled here: #41 without any description why it was done.
These changes improve data integrity, maintain referential integrity between different tables, and ensure that the application's behavior remains consistent and predictable when handling database records, particularly in delete operations.
https://gorm.io/docs/gorm_config.html#DisableForeignKeyConstraintWhenMigrating
Fixes #1482