-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (32 loc) · 1.16 KB
/
Makefile
File metadata and controls
45 lines (32 loc) · 1.16 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#still figuring this out --dakota
#can these be gotten from the .env? idk yet
PGUSER=postgres
PGPASS=12345
PGDATABASE=choicemovers
################################################
PGURL=postgresql://$(PGUSER):$(PGPASS)@localhost:5432/$(PGDATABASE)?sslmode=disable
backend:
docker compose up --build -d
api:
docker compose up --build backend -d
db:
docker compose up --build db -d
createdb:
docker exec -it db createdb --username=$(PGUSER) --owner=$(PGUSER) $(PGDATABASE)
dropdb:
docker exec -it db dropdb -U $(PGUSER) $(PGDATABASE)
cleandb:
docker exec -it db dropdb -U $(PGUSER) $(PGDATABASE)
docker exec -it db createdb --username=$(PGUSER) --owner=$(PGUSER) $(PGDATABASE)
migrate -path database/migration -database "$(PGURL)" -verbose up
./insert_test_data.sh
migrateup:
migrate -path database/migration -database "$(PGURL)" -verbose up
migrateup1:
migrate -path database/migration -database "$(PGURL)" -verbose up 1
migratedown:
migrate -path database/migration -database "$(PGURL)" -verbose down
migratedown1:
migrate -path database/migration -database "$(PGURL)" -verbose down 1
newmigration:
migrate create -ext sql -dir database/migration -seq $(name)