From 2a1bda653dfddf4ac904a7a0b9f69d8eee0bb499 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 27 Jun 2023 19:46:54 +0530 Subject: [PATCH] feat: run migrations using sqlx also --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index bf5a8ced..d4cee1b8 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,13 @@ define run_migrations ## run database migrations cd db/db-migrations/ && cargo run endef +define run_dev_migrations ## run database migrations + cd db/db-sqlx-maria/ && \ + DATABASE_URL=${MARIA_DATABASE_URL} sqlx migrate run + cd db/db-sqlx-postgres/ && \ + DATABASE_URL=${POSTGRES_DATABASE_URL} sqlx migrate run +endef + define frontend_env ## install frontend deps yarn install cd docs/openapi && yarn install @@ -128,6 +135,9 @@ lint: ## Lint codebase migrate: ## Run database migrations $(call run_migrations) +migrate.dev: ## Run database migrations during development + $(call run_dev_migrations) + release: frontend ## Build app with release optimizations $(call cache_bust) cargo build --release