feat(story-1.2): add database migration system with golang-migrate

This commit is contained in:
Michael committed 2026-02-04 14:39:44 +01:00
1 parent 99f1300e13
commit caa1d885b6
7 files changed
+165 -26

No files matched your search

+17 -4
View File
@@ -1,4 +1,4 @@
.PHONY: dev build run test lint clean docker-up docker-down migrate-up migrate-down
.PHONY: dev build run test lint clean docker-up docker-down migrate-up migrate-down migrate-create
# Development
dev:
@@ -32,12 +32,25 @@ docker-down:
docker-logs:
docker-compose logs -f
# Database migrations (placeholder for Story 1.2)
# Database migrations
# Requires: go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
DB_URL ?= postgres://flowreader:flowreader@localhost:5432/flowreader?sslmode=disable
migrate-up:
@echo "Migration system not yet configured (Story 1.2)"
migrate -path ./migrations -database "$(DB_URL)" up
migrate-down:
@echo "Migration system not yet configured (Story 1.2)"
migrate -path ./migrations -database "$(DB_URL)" down 1
migrate-drop:
migrate -path ./migrations -database "$(DB_URL)" drop -f
migrate-create:
@read -p "Migration name: " name; \
migrate create -ext sql -dir ./migrations -seq $$name
migrate-version:
migrate -path ./migrations -database "$(DB_URL)" version
# Cleanup
clean: