● videoThe Rewrite
Flexing Make

Unlock Revisiting Ruby on Rails
Subscribe for full access to every course, or buy this one on its own.
SECTION
The Rewrite
NEXT UP
Using Scaffold With Existing Data
COURSE
Rails Revisited
33 lessons
About this lesson
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.
Unlock Revisiting Ruby on Rails
Subscribe for full access to every course, or buy this one on its own.