How to use models::_entities::users in migration #392
Answered
by
jondot
fan-tastic-z
asked this question in
Q&A
-
In migration, the data structure of the model cannot be used directly. How to configure Cargo.toml? I tried to add the configuration to the Cargo.toml of the migration, but it would cyclic package dependency error |
Beta Was this translation helpful? Give feedback.
Answered by
jondot
Aug 7, 2024
Replies: 1 comment 4 replies
-
I know this is a bit old but I am running into this as well. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @BWStearns , after investigating this a bit, we're coming to conclusion that we're going to drop the recommendation to run data fixes in migrations using the actual entities.
The major reason is that while you're trying to modify data or DDL, your entities might already be incompatible (because you changed values or structure) and so it makes less sense to use the
model
abstractions here.The original suggestion came from the SeaORM docs (https://www.sea-ql.org/SeaORM/docs/migration/writing-migration/#tip-3-seed-data-with-entity) however, we think that since there's some manual work involved in that example, the expectation is from the user to "operate" what ever issue that arises.…