{"repo":"andywer/plow","free":true,"listed":false,"github":"https://github.com/andywer/plow","clone":"git clone https://github.com/andywer/plow.git","description":"👨‍🌾 Postgres migrations and seeding made easy","language":"TypeScript","stars":14,"topics":["database","migration","migrations","seed","seeding","postgresql","postgres","postgres-migrations","docker"],"license":"MIT","category":"databases-storage","readme_excerpt":"Plow :man farmer: Postgres migrations & seeding made easy Plow is a no-non-sense tool to quickly and easily apply database migrations and seed PostgresQL databases. The migrations are managed using postgres-migrations . Installation Usage - Command line tool Use npx to run a locally installed plow like this: Usage - Docker Use the andywer/plow docker image. You can add it to your docker-compose.yml file like this: Now every time you run docker-compose up your database will automatically have all migrations and seeds applied! :rocket: Note that we assume you have a local migrations and a seeds directory that we can mount into the container and that you have a .env file next to your docker-compose file: The output of docker-compose up will look something like this: Migration files Migration files can either be plain SQL files or JavaScript files. There are only up migrations, no down migrations – this is a design decision. Read more about it here. A good scheme to name your migration files is: So the very first migration file would be called 01-v0.1.0-initial.sql or similar. Seed files Seed files are supposed to be plain SQL files. FAQs Error: Migration failed. Reason: Hashes don't match for migrations Plow uses postgres-migrations which sets up a migration table and stores a hash for every migration run. You will see this error if you change a migration file (during development, I hope) that you already applied and run plow again. Only during development: Assuming that you hav","default_branch":null,"files":null,"tree":[],"storefront":"/r/andywer","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/andywer/plow/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}