-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (39 loc) · 887 Bytes
/
Makefile
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
45
46
47
48
49
50
51
52
53
54
55
56
.PHONY: install build run watch clean db db-stop db-setup db-reset migration migrate migrate-redo migrate-status dev reset setup
DATABASE_URL=postgres://user:password@localhost/feed_a_dev
MIGRATION_DIR=migrations
install:
cargo install diesel_cli --no-default-features --features postgres
cargo install cargo-watch
cargo install --path .
build:
cargo build
run:
cargo run
watch:
cargo watch -x run
clean:
cargo clean
db:
docker compose up -d
@sleep 3
db-stop:
docker compose down
db-setup:
diesel setup
diesel migration run
db-reset:
diesel database reset
migration:
@if [ "$(name)" = "" ]; then \
exit 1; \
fi
diesel migration generate $(name)
migrate:
diesel migration run
migrate-redo:
diesel migration redo
migrate-status:
diesel migration list
dev: db db-setup run
reset: clean db-stop db db-reset build run
setup: install db db-setup build run