forge/docker/migrate_add_password.sql
DJP 7a804e896d Initial commit - FORGE AI unified platform
Features:
- Image generation (OpenAI, Gemini, Leonardo, Bria, Stability, Flux)
- Nano Banana iterative editing
- Video generation and upscaling
- Audio TTS, STT, sound effects (ElevenLabs)
- Text prompt studio and alt text
- User authentication with JWT/cookies
- Admin panel with voice management
- Job queue with Celery
- PostgreSQL + Redis backend
- Next.js 15 + FastAPI architecture

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
2025-12-09 20:39:00 -05:00

26 lines
1 KiB
SQL

-- Migration: Add hashed_password column to users table
-- Run this if you have an existing database without the password column
-- Add hashed_password column if it doesn't exist
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM information_schema.columns
WHERE table_name = 'users' AND column_name = 'hashed_password') THEN
ALTER TABLE users ADD COLUMN hashed_password VARCHAR(255);
END IF;
END $$;
-- Update test user with password "password123" (bcrypt hash)
UPDATE users
SET hashed_password = '$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/X.9QYQxQj9oQx9zWe'
WHERE email = 'test@forge.ai' AND hashed_password IS NULL;
-- If no test user exists, create one
INSERT INTO users (id, email, hashed_password, display_name, role, is_active)
SELECT 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
'test@forge.ai',
'$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/X.9QYQxQj9oQx9zWe',
'Test User',
'admin',
true
WHERE NOT EXISTS (SELECT 1 FROM users WHERE email = 'test@forge.ai');