-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (18 loc) · 777 Bytes
/
Makefile
File metadata and controls
27 lines (18 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-include .env
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?sslmode=disable
all: build down up
build:
docker-compose build
up:
docker-compose up -d
down:
docker-compose down
psql:
docker exec -it tracker__db psql -U postgres -d ${POSTGRES_DB}
migrate:
docker-compose run --rm api migrate -path internal/db/migrations -database ${DATABASE_URL} -verbose up
downgrade:
docker-compose run --rm api migrate -path internal/db/migrations -database ${DATABASE_URL} -verbose down 1
makemigration:
docker-compose run --rm --volume=${PWD}/internal/db/migrations:/app/internal/db/migrations api migrate create -ext sql -dir internal/db/migrations -seq ${NAME}
sudo chown -R ${USER} internal/db/migrations