-
Notifications
You must be signed in to change notification settings - Fork 7
Creating a Postgres Database and Migrations
Eric Yen edited this page Mar 31, 2019
·
2 revisions
-
install postgresql
sudo apt-get install postgresql
-
create a default password for the default postgres user see https://stackoverflow.com/a/12721020/701403
-
download dbmate
sudo curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/download/v1.4.1/dbmate-linux-amd64; sudo chmod +x /usr/local/bin/dbmate
-
setup dbmate
export DATABASE_URL="postgres://postgres:[email protected]:5432/DriveFS?sslmode=disable"
-
create the database
cd DriveFS dbmate create
-
migrate the base
dbmate migrate