Drop files here

SQL upload ( 0 ) x -

Page-related settings Click on the bar to scroll to top of page
Press Ctrl+Enter to execute query Press Enter to execute query
ascending
descending
Order:
Debug SQL
Count
Execution order
Time taken
Order by:
Group queries
Ungroup queries
Collapse Expand Show trace Hide trace Count : Time taken :
Bookmarks
Refresh
Add
No bookmarks
Add bookmark
Options
Set default





Collapse Expand Requery Edit Explain Profiling Bookmark Query failed Database : Queried time :
Untitled *
v Show/Hide tables list View in fullscreen Add tables from other databases New page Open page Save page Save page as Delete pages Create table Create relationship Choose column to display Reload Help Angular links / Direct links Snap to grid v Small/Big All Toggle small/big Toggle relationship lines Export schema > Move Menu > Pin text
Number of tables: 0
v diabetes_system_fixed_20260625_231138 alerts
* id : int(11)
* alert_type : enum('LOW','HIGH','RAPID_DROP','RAPID_RISE')
* glucose_value : int(11)
* message : text
* created_at : timestamp
* severity : enum('WATCH','URGENT','EMERGENCY')
* status : enum('OPEN','ACKNOWLEDGED')
* acknowledged_at : datetime
* acknowledged_by : int(11)
* parent_note : text
v diabetes_system_fixed_20260625_231138 app_settings
* id : int(11)
* expected_cgm_interval_minutes : int(11)
* stale_after_minutes : int(11)
* offline_after_minutes : int(11)
* duplicate_insulin_minutes : int(11)
* telegram_escalation_minutes : int(11)
* backup_retention_count : int(11)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 audit_logs
* id : bigint(20)
* user_id : int(11)
* action : varchar(60)
* table_name : varchar(80)
* record_id : varchar(80)
* old_value : longtext
* new_value : longtext
* reason : varchar(255)
* ip_address : varchar(64)
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 backup_history
* id : bigint(20)
* filename : varchar(255)
* encrypted : tinyint(1)
* table_count : int(11)
* row_count : int(11)
* created_by : int(11)
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 cgm_readings
* id : int(11)
* glucose_value : int(11)
* trend : varchar(20)
* device_source : varchar(50)
* recorded_at : timestamp
* reading_source : varchar(40)
* is_confirmed : tinyint(1)
* confirmation_value : int(11)
* confirmation_time : datetime
* sensor_id : int(11)
v diabetes_system_fixed_20260625_231138 daily_summary
* date : date
* avg_glucose : decimal(14,4)
* max_glucose : int(11)
* min_glucose : int(11)
* readings_count : bigint(21)
v diabetes_system_fixed_20260625_231138 doctor_prescriptions
* id : bigint(20)
* prescription_date : date
* doctor_name : varchar(160)
* specialization : varchar(160)
* clinic_name : varchar(190)
* diagnosis : varchar(255)
* medicines_instructions : mediumtext
* notes : text
* follow_up_date : date
* created_by : int(11)
* created_at : timestamp
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 doctor_prescription_files
* id : bigint(20)
* prescription_id : bigint(20)
* original_name : varchar(255)
* stored_name : varchar(255)
* mime_type : varchar(100)
* file_size : int(10) unsigned
* sha256 : char(64)
* uploaded_at : timestamp
v diabetes_system_fixed_20260625_231138 document_repository
* id : bigint(20)
* display_name : varchar(255)
* category : varchar(80)
* description : text
* document_date : date
* expiry_date : date
* original_name : varchar(255)
* stored_name : varchar(255)
* mime_type : varchar(150)
* file_extension : varchar(16)
* file_size : bigint(20) unsigned
* sha256 : char(64)
* created_by : int(11)
* created_at : timestamp
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 emergency_contacts
* id : int(11)
* contact_name : varchar(100)
* relationship : enum('Parent','Guardian','Teacher','School Nurse','Doctor','Other')
* phone_number : varchar(30)
* telegram_chat_id : varchar(64)
* email : varchar(120)
* receive_critical : tinyint(1)
* receive_school : tinyint(1)
* receive_sick_day : tinyint(1)
* is_primary : tinyint(1)
* active : tinyint(1)
* created_at : timestamp
* escalation_order : int(11)
v diabetes_system_fixed_20260625_231138 gia_custom_foods
* id : int(10) unsigned
* food_name : varchar(150)
* aliases : varchar(255)
* serving_amount : decimal(10,2)
* serving_unit : varchar(30)
* carbs_per_serving : decimal(10,2)
* category : varchar(30)
* source_note : varchar(255)
* active : tinyint(1)
* created_at : datetime
v diabetes_system_fixed_20260625_231138 gia_log_edit_audit
* id : bigint(20) unsigned
* table_name : varchar(64)
* record_id : bigint(20)
* old_values : longtext
* new_values : longtext
* edit_reason : varchar(255)
* edited_by : varchar(150)
* edited_at : datetime
v diabetes_system_fixed_20260625_231138 health_events
* id : int(11)
* event_type : enum('activity','illness','fever','vomiting','stress','hypo_treatment','other')
* event_time : datetime
* title : varchar(120)
* details : text
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 insulin_action_reviews
* id : bigint(20) unsigned
* insulin_log_id : int(11)
* review_type : varchar(40)
* due_at : datetime
* telegram_sent : tinyint(1)
* sent_at : datetime
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 insulin_dose_rules
* id : int(11)
* rule_name : varchar(100)
* glucose_min : int(11)
* glucose_max : int(11)
* units : decimal(5,2)
* reason : enum('meal_snack','meal','snack','correction')
* active : tinyint(1)
* sort_order : int(11)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 insulin_logs
* id : int(11)
* insulin_type : enum('rapid','long','correction')
* units : decimal(5,2)
* injection_time : timestamp
* notes : text
* linked_glucose : int(11)
* meal_carbs : int(11)
* reason : enum('meal','correction','basal')
* insulin_name : varchar(50)
* entry_status : enum('active','corrected')
* correction_reason : varchar(255)
v diabetes_system_fixed_20260625_231138 insulin_summary
* date : date
* total_units : decimal(27,2)
v diabetes_system_fixed_20260625_231138 ketone_logs
* id : int(11)
* glucose_value : int(11)
* ketone_result : enum('negative','trace','small','moderate','large')
* action_taken : varchar(255)
* notes : text
* logged_at : timestamp
* entry_status : enum('active','corrected')
v diabetes_system_fixed_20260625_231138 login_attempts
* id : int(11)
* email : varchar(255)
* ip_address : varchar(45)
* attempted_at : datetime
* success : tinyint(1)
* successful : tinyint(1)
v diabetes_system_fixed_20260625_231138 meal_logs
* id : int(11)
* meal_type : enum('breakfast','lunch','dinner','snack')
* carbs : int(11)
* description : text
* meal_time : timestamp
* computed_kcal : int(11)
* display_unit : varchar(10)
* meal_plan_key : varchar(50)
* meal_plan_name : varchar(120)
* meal_suggestion : text
* entry_status : enum('active','corrected')
* correction_reason : varchar(255)
v diabetes_system_fixed_20260625_231138 meal_plan_slots
* id : int(11)
* slot_key : varchar(30)
* db_meal_type : enum('breakfast','lunch','dinner','snack')
* label : varchar(100)
* suggested_time : time
* window_start : time
* window_end : time
* rice_exchange : decimal(5,2)
* meat_exchange : decimal(5,2)
* fruit_exchange : decimal(5,2)
* veg_cups : decimal(5,2)
* active : tinyint(1)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 meal_plan_templates
* id : int(11)
* plan_key : varchar(50)
* plan_name : varchar(120)
* description : text
* no_added_sugar : tinyint(1)
* is_default : tinyint(1)
* active : tinyint(1)
* sort_order : int(11)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 meal_plan_template_items
* id : int(11)
* plan_key : varchar(50)
* slot_key : varchar(30)
* suggestion_text : text
* alternative_text : text
* sugar_note : varchar(255)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 meal_schedule_profiles
* id : int(11)
* profile_key : varchar(30)
* label : varchar(100)
* description : text
* active : tinyint(1)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 meal_schedule_profile_slots
* id : int(11)
* profile_key : varchar(30)
* slot_key : varchar(30)
* db_meal_type : enum('breakfast','lunch','dinner','snack')
* label : varchar(100)
* suggested_time : time
* window_start : time
* window_end : time
* rice_exchange : decimal(5,2)
* meat_exchange : decimal(5,2)
* fruit_exchange : decimal(5,2)
* veg_cups : decimal(5,2)
* active : tinyint(1)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 missed_event_logs
* id : int(11)
* event_key : varchar(120)
* event_type : enum('meal','insulin','cgm','basal')
* meal_slot : varchar(30)
* scheduled_time : datetime
* due_time : datetime
* severity : enum('WATCH','URGENT','EMERGENCY')
* message : text
* status : enum('OPEN','ACKNOWLEDGED')
* acknowledged_at : datetime
* acknowledged_by : int(11)
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 patient_profile
* id : int(11)
* user_id : int(11)
* patient_name : varchar(100)
* age_years : int(11)
* weight_kg : decimal(5,2)
* target_low : int(11)
* target_high : int(11)
* insulin_carb_ratio : decimal(5,2)
* correction_factor : decimal(5,2)
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 pediatric_safety_settings
* id : int(11)
* low_no_bolus_threshold : int(11)
* severe_low_threshold : int(11)
* target_low : int(11)
* target_high : int(11)
* ketone_threshold : int(11)
* urgent_high_threshold : int(11)
* active_insulin_hours : decimal(4,2)
* rapid_insulin_name : varchar(50)
* basal_insulin_name : varchar(50)
* rapid_onset_minutes : int(11)
* rapid_peak_minutes : int(11)
* basal_scheduled_time : time
* basal_half_life_hours : decimal(5,2)
* basal_duration_hours : decimal(5,2)
* basal_steady_state_days : int(11)
* basal_review_days : int(11)
* basal_late_tolerance_minutes : int(11)
* overnight_start : time
* overnight_end : time
* overnight_review_days : int(11)
* kg_per_unit : decimal(5,2)
* max_single_bolus : decimal(5,2)
* novorapid_before_meal_minutes : int(11)
* rice_exchange_carbs : decimal(5,2)
* fruit_exchange_carbs : decimal(5,2)
* meat_exchange_carbs : decimal(5,2)
* veg_cup_carbs : decimal(5,2)
* display_unit : enum('grams','kcal')
* current_schedule_profile : varchar(30)
* current_meal_plan_key : varchar(50)
* rice_exchange_kcal : decimal(6,2)
* fruit_exchange_kcal : decimal(6,2)
* meat_exchange_kcal : decimal(6,2)
* veg_cup_kcal : decimal(6,2)
* correction_1800_enabled : tinyint(1)
* correction_tdd_units : decimal(6,2)
* correction_target_mgdl : int(11)
* correction_min_glucose : int(11)
* correction_rounding_increment : decimal(3,2)
* correction_rounding_mode : enum('down','nearest')
* correction_min_interval_minutes : int(11)
* correction_max_units : decimal(5,2)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 record_corrections
* id : bigint(20)
* source_table : enum('cgm_readings','insulin_logs','meal_logs','ketone_logs')
* source_id : bigint(20)
* field_name : varchar(80)
* old_value : text
* new_value : text
* reason : varchar(255)
* corrected_by : int(11)
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 sensors
* id : int(11)
* sensor_model : varchar(100)
* sensor_serial : varchar(120)
* reader_name : varchar(120)
* body_location : varchar(80)
* started_at : datetime
* expected_expires_at : datetime
* removed_at : datetime
* status : enum('active','completed','failed','removed')
* skin_reaction : text
* failure_notes : text
* replacement_sensor : varchar(120)
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 settings
* id : int(11)
* target_low : int(11)
* target_high : int(11)
* correction_factor : decimal(5,2)
* carb_ratio : decimal(5,2)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 sms_alert_logs
* id : int(11)
* alert_key : varchar(100)
* severity : enum('INFO','WARNING','CRITICAL')
* glucose_value : int(11)
* trend : varchar(50)
* message : text
* recipients : text
* provider : varchar(50)
* provider_response : text
* sent_status : enum('SENT','FAILED','SKIPPED')
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 sms_contacts
* id : int(11)
* contact_name : varchar(100)
* phone_number : varchar(20)
* relationship : varchar(50)
* receive_critical : tinyint(1)
* receive_routine : tinyint(1)
* active : tinyint(1)
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 sms_delivery_logs
* id : int(11)
* alert_key : varchar(120)
* severity : enum('INFO','WARNING','CRITICAL')
* glucose_value : int(11)
* trend : varchar(50)
* message : text
* recipients : text
* provider : varchar(30)
* http_code : int(11)
* provider_response : mediumtext
* sent_status : enum('SENT','FAILED','SKIPPED')
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 sms_settings
* id : int(11)
* sms_enabled : tinyint(1)
* provider : varchar(50)
* sender_name : varchar(50)
* critical_cooldown_minutes : int(11)
* warning_cooldown_minutes : int(11)
* school_check_start : time
* school_check_end : time
* no_cgm_minutes_school : int(11)
* created_at : timestamp
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 system_modes
* id : int(11)
* school_mode : tinyint(1)
* sick_day_mode : tinyint(1)
* notify_teacher_in_school : tinyint(1)
* sms_critical_enabled : tinyint(1)
* telegram_critical_enabled : tinyint(1)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 telegram_alert_state
* state_key : varchar(80)
* state_value : varchar(255)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 telegram_bot_state
* state_key : varchar(50)
* state_value : varchar(255)
* updated_at : timestamp
v diabetes_system_fixed_20260625_231138 telegram_delivery_logs
* id : int(11)
* alert_key : varchar(120)
* severity : enum('INFO','WARNING','CRITICAL')
* glucose_value : int(11)
* trend : varchar(50)
* message : text
* recipients : text
* http_code : int(11)
* provider_response : mediumtext
* sent_status : enum('SENT','FAILED','SKIPPED')
* created_at : timestamp
v diabetes_system_fixed_20260625_231138 telegram_event_log
* id : bigint(20) unsigned
* event_key : varchar(191)
* event_type : varchar(60)
* message : text
* sent_at : datetime
v diabetes_system_fixed_20260625_231138 telegram_subscribers
* id : bigint(20) unsigned
* chat_id : varchar(32)
* chat_type : varchar(30)
* username : varchar(255)
* first_name : varchar(255)
* last_name : varchar(255)
* active : tinyint(1)
* created_at : datetime
* updated_at : datetime
v diabetes_system_fixed_20260625_231138 treatment_plans
* id : int(11)
* version_name : varchar(100)
* effective_date : date
* target_low : int(11)
* target_high : int(11)
* rapid_insulin_name : varchar(60)
* basal_insulin_name : varchar(60)
* meal_scale_text : text
* correction_text : text
* basal_schedule_text : text
* low_treatment_text : text
* ketone_sick_day_text : text
* clinic_name : varchar(150)
* notes : text
* active : tinyint(1)
* created_at : timestamp
* total_daily_dose : decimal(6,2)
* correction_target_mgdl : int(11)
* correction_isf : decimal(7,2)
* correction_min_interval_minutes : int(11)
v diabetes_system_fixed_20260625_231138 users
* id : int(11)
* name : varchar(255)
* email : varchar(255)
* password : varchar(255)
* role : varchar(50)
* created_at : datetime
v diabetes_system_fixed_20260625_231138 weight_history
* id : bigint(20)
* user_id : int(11)
* weight_kg : decimal(5,2)
* measured_at : datetime
* notes : varchar(255)
* source : varchar(30)
* created_at : timestamp
Create relationship
FOREIGN KEY
on delete
on update
Delete relationship