Skip to content

Commit

Permalink
revise: makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
labasubagia committed Sep 15, 2023
1 parent db60635 commit 0f3e992
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
DB_URL=postgresql://postgres:postgres@0.0.0.0:5432/realworld?sslmode=disable
DB_MIGRATION_PATH=internal/adapter/repository/sql/db/migration
# database

migrate_up:
migrate -path "$(DB_MIGRATION_PATH)" -database "$(DB_URL)" -verbose up
POSTGRES_URL=postgresql://postgres:postgres@0.0.0.0:5432/realworld?sslmode=disable
POSTGRES_MIGRATION_PATH=internal/adapter/repository/sql/db/migration

migrate_down:
migrate -path "$(DB_MIGRATION_PATH)" -database "$(DB_URL)" -verbose down
postgres_migrate_up:
migrate -path "$(POSTGRES_MIGRATION_PATH)" -database "$(POSTGRES_URL)" -verbose up

migrate_drop:
migrate -path "$(DB_MIGRATION_PATH)" -database "$(DB_URL)" -verbose drop
postgres_migrate_down:
migrate -path "$(POSTGRES_MIGRATION_PATH)" -database "$(POSTGRES_URL)" -verbose down

postgres_migrate_drop:
migrate -path "$(POSTGRES_MIGRATION_PATH)" -database "$(POSTGRES_URL)" -verbose drop

# testing

test:
go test -cover ./...
Expand Down

0 comments on commit 0f3e992

Please sign in to comment.