kevin-meyers / data-scout

A webapp that helps you manage and explore your data
https://datascout.io/
2 stars 0 forks source link

Steps to improve development scenario #216

Open kevin-meyers opened 3 years ago

kevin-meyers commented 3 years ago

Disconnect from the proxy Create a docker image to host a local psql (and write some seed data that gets pulled in on image create) Start printing my migrations to a folder somewhere and a script to handle applying them to production

Needs breaking into issues

kevin-meyers commented 3 years ago

Yesod (and more specifically, Persistent) has migration support. There's a section on migrations in the Persistent chapter of the Yesod Book: https://www.yesodweb.com/book/persistent#persistent_migrations For development, it's fine to let Yesod perform the migrations for you. For deploying to production, I strongly recommend only printing the migrations (which is just a matter of using the printMigration function instead of the runMigration function). In order to actually trigger the migrations, one thing we've done in the past is make a little command line executable in addition to the main webserver executable (requires defining another executable section in your .cabal file) that is compiled/executed separately. If your project is called "foobar", you may produce a foobar-server and a foobar-cli, the latter of which can take args to toggle between running migrations in development mode and printing migrations for

kevin-meyers commented 3 years ago

Dockerfile set up successfully! Remaining tasks: