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 |
Answered by
jondot
Aug 7, 2024
Replies: 2 comments 7 replies
|
I know this is a bit old but I am running into this as well. |
5 replies
|
This also applies to the documentation for creating indices, dropping columns, and adding columns, doesn't it? I'm making an index creation migration, and the documentation still recommends that I use the entities. I'm going to just use raw SQL, but the documentation for these things should probably be fixed. |
2 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
modelabstractions 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.…