-- Insert initial reference data
\c trading_bot;

-- Insert basic exchanges to start with
INSERT INTO exchanges (code, name, country, currency) VALUES
    ('NASDAQ', 'NASDAQ Stock Market', 'US', 'USD'),
    ('NYSE', 'New York Stock Exchange', 'US', 'USD'),
    ('TSX', 'Toronto Stock Exchange', 'CA', 'CAD'),
    ('LSE', 'London Stock Exchange', 'GB', 'GBP'),
    ('CME', 'Chicago Mercantile Exchange', 'US', 'USD')
ON CONFLICT (code) DO NOTHING;

-- Insert initial sync status records for QM provider
INSERT INTO sync_status (provider, data_type) VALUES
    ('qm', 'symbols'),
    ('qm', 'exchanges')
ON CONFLICT (provider, data_type) DO NOTHING;

-- Show what we created
SELECT 'Database setup complete. Tables created:' as status;
SELECT table_name FROM information_schema.tables 
WHERE table_schema = 'public' 
ORDER BY table_name;