mirror of
https://github.com/polaroi8d/cactoide.git
synced 2026-03-22 06:05:28 +00:00
feat: add db-seed to makefile and merge migrations
This commit is contained in:
14
Makefile
14
Makefile
@@ -1,4 +1,4 @@
|
||||
.PHONY: help build up down db-only logs db-clean prune i18n lint format migrate-up migrate-down
|
||||
.PHONY: help build up down db-only db-seed logs db-clean prune i18n lint format migrate-up migrate-down
|
||||
|
||||
# Database connection variables
|
||||
DB_HOST ?= localhost
|
||||
@@ -19,6 +19,7 @@ help:
|
||||
@echo " up - Start all services"
|
||||
@echo " down - Stop all services"
|
||||
@echo " db-only - Start only the database"
|
||||
@echo " db-seed - Seed the database with sample data"
|
||||
@echo " logs - Show logs from all services"
|
||||
@echo " db-clean - Clean up all Docker resources"
|
||||
@echo " prune - Clean up everything (containers, images, volumes)"
|
||||
@@ -73,6 +74,17 @@ db-only:
|
||||
@echo "Starting only the database..."
|
||||
docker compose up -d postgres
|
||||
|
||||
# Seed the database with sample data
|
||||
db-seed:
|
||||
@echo "Seeding database with sample data..."
|
||||
@if [ -f "database/seed.sql" ]; then \
|
||||
psql "$(DB_URL)" -f database/seed.sql && \
|
||||
echo "Database seeded successfully!"; \
|
||||
else \
|
||||
echo "Seed file not found: database/seed.sql"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# Show logs from all services
|
||||
logs:
|
||||
@echo "Showing logs from all services..."
|
||||
|
||||
Reference in New Issue
Block a user