Skip to content

Is there a migration API? #4189

Answered by weiznich
marvin-hansen asked this question in Q&A
Discussion options

You must be logged in to vote

The migration API is provided by the diesel_migrations crate. Notability that does not only provide the embed_migrations! macro but also a run time based solution. It's also possible to just provide your own migration source by implementing the relevant trait. 0See the existing implementations in that crate for examples.

Then, unsurprisingly, it's not portable especially when CI worker generate isolated sandboxes dynamically.

I don't think it's possible to have an isolated macro that reads from the file system. You need to choose there: Either you use the embed_migration! macro to embed the migrations into your binary. That allows you to just ship a single binary that contains everythin…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by marvin-hansen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants