Skip to content

Commit

Permalink
Fix db commands in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
guvra committed Jan 8, 2024
1 parent 5d87c0b commit 9f05336
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ test: vendor ## Run phpunit.
.PHONY: db
db: service := --wait db
db: up ## Connect to the database.
$(DOCKER_COMPOSE) exec db sh -c 'mysql --user=$$MYSQL_USER --password=$$MYSQL_PASSWORD'
$(DOCKER_COMPOSE) exec db sh -c 'mysql --password=$$MYSQL_ROOT_PASSWORD'

.PHONY: db-import
db-import: service := --wait db
db-import: up ## Execute a SQL file. Pass the parameter "filename=" to set the filename (default: dump.sql).
$(eval filename ?= dump.sql)
$(DOCKER_COMPOSE) exec -T db sh -c 'mysql --user=$$MYSQL_USER --password=$$MYSQL_PASSWORD' < $(filename)
$(DOCKER_COMPOSE) exec -T db sh -c 'mysql --password=$$MYSQL_ROOT_PASSWORD' < $(filename)

vendor: composer.json
$(PHP_CLI) composer install
Expand Down

0 comments on commit 9f05336

Please sign in to comment.