This repository was archived by the owner on Sep 30, 2024. It is now read-only.
fix/enterpriseportal: drop old gorm fk constraints#63864
Merged
Conversation
This was referenced Jul 16, 2024
Member
Author
58e9fb2 to
64c3a46
Compare
64c3a46 to
ee2b5cb
Compare
bobheadxi
commented
Jul 16, 2024
| type TableSubscriptionLicense struct { | ||
| // ⚠️ DO NOT USE: This field is only used for creating foreign key constraint. | ||
| Conditions *[]SubscriptionLicenseCondition `gorm:"foreignKey:LicenseID"` | ||
| Conditions []*SubscriptionLicenseCondition `gorm:"foreignKey:LicenseID"` |
Member
Author
There was a problem hiding this comment.
just a consistency change
Contributor
There was a problem hiding this comment.
The interface of RunCustomMigrations is smart! but really feeling like time to invest a proper migration system 😂
jac
approved these changes
Jul 17, 2024
This was referenced Jul 18, 2024
This was referenced Jul 25, 2024
This was referenced Aug 2, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Turns out,
gormdoes not auto-migrate constraints you've removed from the struct schema. You must drop them by hand, or run the commands to drop them explicitly.Test plan
then, comment the custom migrations, and run
sg start -cmd enterprise-portalagain to re-do the migrations. The output of\d+matches. Unexpected constraints are gone.