2025-05-29 23:50:41 +08:00
|
|
|
-- 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';
|
|
|
|
|
|
2025-05-30 18:20:38 +08:00
|
|
|
-- The database user is automatically created by Docker with the POSTGRES_USER and POSTGRES_PASSWORD
|
|
|
|
|
-- environment variables, so we don't need to create it here
|
2025-05-29 23:50:41 +08:00
|
|
|
|
|
|
|
|
-- Create initial comment
|
2025-05-30 17:45:57 +08:00
|
|
|
COMMENT ON DATABASE dashboard IS 'Crypto Trading Bot Dashboard Database';
|
|
|
|
|
|
2025-05-30 18:20:38 +08:00
|
|
|
-- Execute the clean schema file (without TimescaleDB hypertables for simpler setup)
|
|
|
|
|
\i /docker-entrypoint-initdb.d/schema_clean.sql
|