Flexing Make

Buy or Subscribe

You can access this course in just a minute, and support my efforts to rid the world of crappy online courses!

Buy Standalone  Subscribe

Make is an old tool with one job: orchestrate shell commands. It's used to build things, and is the oldest build tool there is. We can use this power to build out our database!
rebuild: dev change schema migrate

migrate:
  rails db:migrate

schema:
  rails db:schema:dump

dev:
  psql -q railz_development < db.sql

change:
  psql -q railz_development < change.sql


.PHONY: dev change migrate schema db
This file will run the commands in order, creating our dev database, running our SQL scripts, and finally any migrations.