-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 1.05 KB
/
Makefile
File metadata and controls
49 lines (38 loc) · 1.05 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: build test test-cover test-verbose clean migrate-build
# Build migrate CLI
build:
@echo "Building migrate CLI..."
@go build -o bin/migrate ./cmd/migrate
# Run all tests
test:
@go test ./pkg/...
# Run tests with coverage
test-cover:
@go test ./pkg/... -cover
# Run tests with verbose output
test-verbose:
@go test ./pkg/... -v
# Clean build artifacts
clean:
@rm -rf bin/
# Build migrate CLI (alias)
migrate-build: build
# ---------------------------------------------------------
# Migration Commands (require DATABASE_URL to be set)
# ---------------------------------------------------------
# Run pending migrations
migrate-up: build
@./bin/migrate up
# Rollback last migration
migrate-down: build
@./bin/migrate down
# Show migration status
migrate-status: build
@./bin/migrate status
# Create new migration: make migrate-create name=add_users_table
migrate-create: build
@if [ -z "$(name)" ]; then \
echo "Error: migration name required. Usage: make migrate-create name=migration_name"; \
exit 1; \
fi
@./bin/migrate create $(name)