From 778960a6dfca8b78428c19ab286fa421c5fabd54 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Fri, 9 Sep 2022 17:16:10 +0530 Subject: [PATCH] feat: prep sqlx-data.json and apply migrations from it --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9d83266..bd87eac 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ check: ## Check for syntax errors on all workspaces clean: ## Delete build artifacts @cargo clean -coverage: migrate ## Generate code coverage report in HTML format +coverage: ## Generate code coverage report in HTML format $(call cache_bust) cargo tarpaulin -t 1200 --out Html @@ -29,6 +29,10 @@ lint: ## Lint codebase cargo fmt -v --all -- --emit files cargo clippy --workspace --tests --all-features +migrate: ## run migrations + unset DATABASE_URL && cargo build + cargo run -- migrate + release: ## Build app with release optimizations cargo build --release @@ -36,6 +40,11 @@ run: ## Run app in debug mode cargo run +sqlx-offline-data: ## prepare sqlx offline data + cargo sqlx prepare \ + --database-url=${POSTGRES_DATABASE_URL} -- \ + --all-features + test: ## Run all available tests cargo test --no-fail-fast