-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
27 lines (19 loc) · 897 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
SHELL := /bin/bash
db_url := postgres://postgres:my_password@localhost:5434/my_database
test_prepare:
DATABASE_URL=postgres://root@localhost:5433/my_database_test diesel migration run --migration-dir=db/migrations
test:
docker-compose -f docker-compose.test.yml exec database_test psql -d my_database_test --c="TRUNCATE questions"
DATABASE_URL=postgres://root@localhost:5433/my_database_test \
cargo test $(T) -- --nocapture --test-threads=1
run_server:
CLIENT_HOST=http://localhost:3000 \
RUST_BACKTRACE=full \
cargo run --bin server
create_migration:
DATABASE_URL=$(db_url) diesel migration generate $(name) --migration-dir=db/migrations
migrate:
DATABASE_URL=$(db_url) diesel migration run --migration-dir=db/migrations
redo_migrate:
DATABASE_URL=$(db_url) diesel migration redo --migration-dir=db/migrations
.PHONY: run_server test test_prepare