Skip to content

How to use models::_entities::users in migration #392

Answered by jondot
fan-tastic-z asked this question in Q&A
Discussion options

You must be logged in to vote

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.…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@BWStearns
Comment options

@jondot
Comment options

Answer selected by fan-tastic-z
@BWStearns
Comment options

@BWStearns
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants