This commit is contained in:
2025-09-08 08:15:58 +02:00
parent 7e603c7c54
commit af48303c94
31 changed files with 2700 additions and 2598 deletions

23
scripts/init-db.sql Normal file
View File

@@ -0,0 +1,23 @@
-- Initialize database for development
-- This script runs when the PostgreSQL container starts
-- Create database if it doesn't exist (this is handled by POSTGRES_DB env var)
-- The database 'portfolio_dev' is created automatically
-- Create user if it doesn't exist (this is handled by POSTGRES_USER env var)
-- The user 'portfolio_user' is created automatically
-- Grant permissions
GRANT ALL PRIVILEGES ON DATABASE portfolio_dev TO portfolio_user;
-- Create schema if it doesn't exist
CREATE SCHEMA IF NOT EXISTS public;
-- Grant schema permissions
GRANT ALL ON SCHEMA public TO portfolio_user;
GRANT ALL ON ALL TABLES IN SCHEMA public TO portfolio_user;
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO portfolio_user;
-- Set default privileges for future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO portfolio_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO portfolio_user;