-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
feat(schema): add ability to ignore specific column changes #3503
Conversation
```ts @Property({ columnType: 'timestamp', extra: 'VIRTUAL GENERATED', ignoreSchemaChanges: ['type', 'extra'], }) changingField!: Date; ``` This is useful for situations such as mikro-orm#1904, where `knex` is unable to properly diff the column.
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.
Looking great, thanks!
Two notes:
- are we sure ignoring
type
andextra
props is enough? we can always add more, so not a big deal, and I guess thetype
here is the most important part - let's document this somewhere, I would go with the https://mikro-orm.io/docs/schema-generator and https://mikro-orm.io/docs/defining-entities pages, cant be very brief note about this, but it should be there, with a small example (with the generated column, that's nice and probably the most important use case for this)
Codecov ReportBase: 99.85% // Head: 99.85% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #3503 +/- ##
=======================================
Coverage 99.85% 99.85%
=======================================
Files 210 210
Lines 12906 12914 +8
Branches 2984 2992 +8
=======================================
+ Hits 12887 12895 +8
Misses 19 19
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@B4nan wow, thanks for the quick review! Added a commit w/ the documentation changes. As for your other comment, when I tested this change against our database, ignoring |
FYI there are some broken links https://github.com/mikro-orm/mikro-orm/actions/runs/3051149375/jobs/4919032117 |
Ah, my bad -- thanks for the fix! |
This is useful for situations such as #1904, where
knex
is unable to properly diff the column.Fixes #1904