initial setup
This commit is contained in:
commit
232a63dfe8
61 changed files with 4985 additions and 0 deletions
20
database/postgres/init/01-init-schemas.sql
Normal file
20
database/postgres/init/01-init-schemas.sql
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
-- Trading Bot Database Schema Initialization
|
||||
|
||||
-- Create schemas
|
||||
CREATE SCHEMA IF NOT EXISTS trading;
|
||||
CREATE SCHEMA IF NOT EXISTS strategy;
|
||||
CREATE SCHEMA IF NOT EXISTS risk;
|
||||
CREATE SCHEMA IF NOT EXISTS audit;
|
||||
|
||||
-- Set search path for the database
|
||||
ALTER DATABASE trading_bot SET search_path TO trading, strategy, risk, audit, public;
|
||||
|
||||
-- Create extensions
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
CREATE EXTENSION IF NOT EXISTS "btree_gin";
|
||||
CREATE EXTENSION IF NOT EXISTS "pg_stat_statements";
|
||||
|
||||
-- Create a read-only user for analytics
|
||||
CREATE USER trading_reader WITH PASSWORD 'reader_pass_dev';
|
||||
GRANT CONNECT ON DATABASE trading_bot TO trading_reader;
|
||||
GRANT USAGE ON SCHEMA trading, strategy, risk, audit TO trading_reader;
|
||||
Loading…
Add table
Add a link
Reference in a new issue