dev setup

This commit is contained in:
Ajasra
2025-05-29 23:50:41 +08:00
parent d90681b788
commit f5b8bd3c96
17 changed files with 1462 additions and 23 deletions

24
database/init/init.sql Normal file
View File

@@ -0,0 +1,24 @@
-- Initial database setup for Crypto Trading Bot Dashboard
-- This script runs when PostgreSQL container starts for the first time
-- Create extensions
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- Set timezone
SET timezone = 'UTC';
-- Create initial user with appropriate permissions (if not exists)
DO $$
BEGIN
IF NOT EXISTS (SELECT FROM pg_catalog.pg_roles WHERE rolname = 'dashboard') THEN
CREATE ROLE dashboard WITH LOGIN PASSWORD 'dashboard123';
END IF;
END
$$;
-- Grant permissions
GRANT ALL PRIVILEGES ON DATABASE dashboard TO dashboard;
GRANT ALL ON SCHEMA public TO dashboard;
-- Create initial comment
COMMENT ON DATABASE dashboard IS 'Crypto Trading Bot Dashboard Database';