# Makefile Changes - Quick Reference

## Location 1: DATABASE Section (After line 78 - after backup-db)

Add these targets:

```makefile
seed:
	@echo Seeding database with comprehensive test data...
	$(PYTHON) scripts/seed_database.py
	@echo Seeding completed successfully

seed-minimal:
	@echo Seeding database with minimal data (admin + 1 vendor)...
	$(PYTHON) scripts/seed_database.py --minimal
	@echo Minimal seeding completed

seed-reset:
	@echo WARNING: This will DELETE ALL existing data!
	$(PYTHON) scripts/seed_database.py --reset
	@echo Database reset and seeded

# Complete database setup (migrate + seed)
db-setup: migrate-up seed
	@echo Database setup complete!
	@echo Run 'make dev' to start development server

db-reset: migrate-down migrate-up seed-reset
	@echo Database completely reset!
```

## Location 2: HELP Section (Around line 270 - in DATABASE help)

Replace:
```makefile
	@echo === DATABASE ===
	@echo   migrate-create message="msg" - Create new migration
	@echo   migrate-up           - Apply pending migrations
	@echo   migrate-down         - Rollback last migration
	@echo   migrate-status       - Show migration status
	@echo   backup-db            - Backup database
	@echo.
```

With:
```makefile
	@echo === DATABASE ===
	@echo   migrate-create message="msg" - Create new migration
	@echo   migrate-up           - Apply pending migrations
	@echo   migrate-down         - Rollback last migration
	@echo   migrate-status       - Show migration status
	@echo   backup-db            - Backup database
	@echo   seed                 - Seed database with comprehensive test data
	@echo   seed-minimal         - Seed minimal data (admin + 1 vendor)
	@echo   seed-reset           - Reset and seed database (destructive!)
	@echo   db-setup             - Complete database setup (migrate + seed)
	@echo   db-reset             - Complete database reset
	@echo.
```

## Location 3: DAILY WORKFLOW Help Section (Around line 305)

Replace:
```makefile
	@echo === DAILY WORKFLOW ===
	@echo   make dev                                # Start development
	@echo   make migrate-create message="feature"  # Create migration
	@echo   make migrate-up                         # Apply migration
	@echo   make test                               # Run tests
```

With:
```makefile
	@echo === DAILY WORKFLOW ===
	@echo   make db-setup                           # Setup database with data
	@echo   make dev                                # Start development
	@echo   make migrate-create message="feature"  # Create migration
	@echo   make migrate-up                         # Apply migration
	@echo   make seed                               # Seed test data
	@echo   make test                               # Run tests
```

## Location 4: help-db target (Around line 310)

Replace:
```makefile
help-db:
	@echo === DATABASE COMMANDS ===
	@echo   migrate-create message="description"   - Create auto-generated migration
	@echo   migrate-create-manual message="desc"   - Create empty migration template
	@echo   migrate-up                             - Apply all pending migrations
	@echo   migrate-down                           - Rollback last migration
	@echo   migrate-status                         - Show current status and history
	@echo   backup-db                              - Create database backup
	@echo.
	@echo TYPICAL WORKFLOW:
	@echo   1. Edit your SQLAlchemy models
	@echo   2. make migrate-create message="add_new_feature"
	@echo   3. Review the generated migration file
	@echo   4. make migrate-up
```

With:
```makefile
help-db:
	@echo === DATABASE COMMANDS ===
	@echo   migrate-create message="description"   - Create auto-generated migration
	@echo   migrate-create-manual message="desc"   - Create empty migration template
	@echo   migrate-up                             - Apply all pending migrations
	@echo   migrate-down                           - Rollback last migration
	@echo   migrate-status                         - Show current status and history
	@echo   backup-db                              - Create database backup
	@echo   seed                                   - Seed comprehensive test data
	@echo   seed-minimal                           - Seed minimal data (admin + 1 vendor)
	@echo   seed-reset                             - Reset and seed (destructive!)
	@echo   db-setup                               - Complete database setup
	@echo   db-reset                               - Complete database reset
	@echo.
	@echo TYPICAL WORKFLOW:
	@echo   1. make db-setup                          # First time setup
	@echo   2. Edit your SQLAlchemy models
	@echo   3. make migrate-create message="add_new_feature"
	@echo   4. Review the generated migration file
	@echo   5. make migrate-up
	@echo   6. make seed                              # Refresh test data if needed
```

## Update .PHONY targets (Around line 2)

Replace:
```makefile
.PHONY: install install-dev install-docs install-all dev test test-coverage lint format check docker-build docker-up docker-down clean help
```

With:
```makefile
.PHONY: install install-dev install-docs install-all dev test test-coverage lint format check docker-build docker-up docker-down clean help seed seed-minimal seed-reset db-setup db-reset
```

## Quick Copy-Paste Version

If you want to add all commands at once, here's the complete DATABASE section replacement:

```makefile
# =============================================================================
# DATABASE MIGRATIONS
# =============================================================================

migrate-create:
	@if "$(message)"=="" (echo Error: Please provide a message. Usage: make migrate-create message="your_description") else ($(PYTHON) -m alembic revision --autogenerate -m "$(message)")

migrate-create-manual:
	@if "$(message)"=="" (echo Error: Please provide a message. Usage: make migrate-create-manual message="your_description") else ($(PYTHON) -m alembic revision -m "$(message)")

migrate-up:
	@echo Running database migrations...
	$(PYTHON) -m alembic upgrade head
	@echo Migrations completed successfully

migrate-down:
	@echo Rolling back last migration...
	$(PYTHON) -m alembic downgrade -1
	@echo Rollback completed

migrate-status:
	@echo Current migration status:
	$(PYTHON) -m alembic current
	@echo.
	@echo Migration history:
	$(PYTHON) -m alembic history --verbose

backup-db:
	@echo Creating database backup...
	@$(PYTHON) scripts/backup_database.py

seed:
	@echo Seeding database with comprehensive test data...
	$(PYTHON) scripts/seed_database.py
	@echo Seeding completed successfully

seed-minimal:
	@echo Seeding database with minimal data (admin + 1 vendor)...
	$(PYTHON) scripts/seed_database.py --minimal
	@echo Minimal seeding completed

seed-reset:
	@echo WARNING: This will DELETE ALL existing data!
	$(PYTHON) scripts/seed_database.py --reset
	@echo Database reset and seeded

# Complete database setup (migrate + seed)
db-setup: migrate-up seed
	@echo Database setup complete!
	@echo Run 'make dev' to start development server

db-reset: migrate-down migrate-up seed-reset
	@echo Database completely reset!
```
