title: flask-migrate usage in production
body: <p>This question is about the usage pattern of flask-migrate when it comes time to deploy. To set up a server or a docker container with your application, you need to create the databases.</p>
  
  <p>Typically as in <a href="https://github.com/miguelgrinberg/flasky" rel="nofollow noreferrer">https://github.com/miguelgrinberg/flasky</a>, the migrations folder is in the root of the project. This makes sense, but it means that in production, the migrations folder is not available if you are pulling the flask application as an installed package.</p>
  
  <p>Is the correct pattern to copy the migrations folder to the container and run an upgrade there, or something else entirely? This seems awkward, because I would have to keep migrations in sync with the version of the app that I'm pulling from the python package repo. I am aware that it is possible to forego migrations entirely and just do <code>db.create_all()</code>, but if that is the answer, then I may be confused about the purpose of db migrations.</p>