U
    !ΨhG  γ                   @   sπ   d Z ed ed ed ed ed ed ed ed ed	 ed
 ed ed ed ed ed ed ed ed ed ed ed ed ed ed ed ed ed ed ed dS )z)
Simple database info without connection
u#   π TIMESHEET DATABASE INFORMATIONz2==================================================u   
π§ Database Configuration:z  Database: timesheetz  Host: localhostz  Port: 5432z  User: postgresu   
π Main Tables:z.  1. developers - Stores developer informationz1  2. activity_records - Stores ActivityWatch datau   
π To Check Your Data:z
1. Using pgAdmin:z   - Connect to localhost:5432z   - Database: timesheetz(   - Run queries from check_database.sqlz
2. Using Command Line:z    psql -U postgres -d timesheetz!   Then run: \dt (to list tables)z%            SELECT * FROM developers;z4            SELECT * FROM activity_records LIMIT 10;z
3. Using Python Scripts:z   python quick_db_check.pyz!   python check_developer_data.pyu   
π Common Queries:a  
-- Check all developers
SELECT developer_id, name, api_token, created_at 
FROM developers;

-- Check today's activity
SELECT developer_id, COUNT(*), SUM(duration)/3600.0 as hours
FROM activity_records 
WHERE DATE(timestamp) = CURRENT_DATE
GROUP BY developer_id;

-- Check if sync is working
SELECT developer_id, MAX(timestamp) as last_sync
FROM activity_records
GROUP BY developer_id;
u   
π‘ Troubleshooting:z>  - No data? Check if sync.sh is running on developer machinesz=  - CORS errors? Fix Apache config (remove duplicate headers)z1  - Can't connect? Check if PostgreSQL is runningN)Ϊ__doc__Ϊprint© r   r   ϊ./db_info.pyΪ<module>   s:   