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 face_x_clinic_db appointments
* id : int(11)
* opd_patient_id : int(11)
* doctor_id : int(11)
* service_id : int(11)
* appointment_datetime : datetime
* duration_minutes : int(11)
* end_datetime : datetime
* status : enum('Scheduled','Confirmed','Completed','Cancelled','No Show')
* notes : text
* created_at : timestamp
* updated_at : timestamp
* created_by : int(11)
v face_x_clinic_db consent_forms
v face_x_clinic_db financial_transactions
* id : int(11)
* transaction_date : datetime
* type : enum('income','expense')
* amount : decimal(12,2)
* category_id : int(11)
* description : varchar(255)
* payee_or_source : varchar(255)
* payment_method : varchar(50)
* reference_number : varchar(100)
* notes : text
* created_by : int(11)
* created_at : timestamp
* updated_at : timestamp
* payment_id : int(11)
* invoice_id : int(11)
v face_x_clinic_db financial_transaction_categories
* id : int(11)
* name : varchar(100)
* description : text
* type : enum('income','expense')
* is_active : tinyint(1)
v face_x_clinic_db invoices
* id : int(11)
* invoice_number : varchar(50)
* opd_patient_id : int(11)
* issue_date : date
* due_date : date
* sub_total : decimal(12,2)
* discount_amount : decimal(12,2)
* tax_amount : decimal(12,2)
* grand_total : decimal(12,2)
* amount_paid : decimal(12,2)
* status : enum('Draft','Unpaid','Partially Paid','Paid','Void')
* notes : text
* terms : text
* created_at : timestamp
* updated_at : timestamp
* created_by : int(11)
v face_x_clinic_db invoice_items
* id : int(11)
* invoice_id : int(11)
* related_treatment_item_id : int(11)
* description : varchar(255)
* quantity : decimal(10,2)
* unit_price : decimal(10,2)
* item_total : decimal(12,2)
v face_x_clinic_db opd_invitations
* id : int(11)
* token : varchar(64)
* patient_name : varchar(255)
* patient_contact : varchar(255)
* status : enum('pending','completed')
* expires_at : datetime
* created_by : int(11)
* created_at : timestamp
* completed_opd_id : int(11)
v face_x_clinic_db opd_patients
* id : int(11)
* opd_number : varchar(10)
* first_name : varchar(100)
* last_name : varchar(100)
* nickname : varchar(50)
* date_of_birth : date
* gender : enum('Male','Female','Other')
* phone_number : varchar(20)
* email : varchar(100)
* contact_channel : enum('WhatsApp','Line','Email','Phone','Other')
* contact_details : varchar(255)
* address_line1 : varchar(255)
* address_line2 : varchar(255)
* city : varchar(100)
* postcode : varchar(10)
* country : varchar(100)
* referral_source : varchar(100)
* medical_conditions : text
* allergies : text
* current_medications : text
* created_at : timestamp
* updated_at : timestamp
* created_by : int(11)
* is_deleted : tinyint(1)
v face_x_clinic_db patient_consents
* id : int(11)
* opd_patient_id : int(11)
* consent_form_id : int(11)
* signing_doctor_id : int(11)
* signed_datetime : datetime
* status : enum('Pending','Signed','Expired')
* generated_pdf_path : varchar(512)
* created_by : int(11)
* created_at : timestamp
* updated_at : timestamp
v face_x_clinic_db patient_images
* id : int(11)
* opd_patient_id : int(11)
* treatment_id : int(11)
* image_type : enum('Before','After','Profile','Other')
* image_path : varchar(512)
* description : varchar(255)
* uploaded_at : timestamp
* uploaded_by : int(11)
v face_x_clinic_db payments
* id : int(11)
* treatment_id : int(11)
* invoice_id : int(11)
* payment_datetime : datetime
* amount : decimal(10,2)
* payment_method : enum('Cash','Credit Card','Bank Transfer','PayPal','Loan','Other')
* payment_method_other : varchar(100)
* reference_number : varchar(100)
* notes : text
* received_by : int(11)
* created_at : timestamp
v face_x_clinic_db products
* id : int(11)
* sku : varchar(100)
* product_name : varchar(255)
* description : text
* unit_name : varchar(50)
* current_stock : decimal(10,2)
* reorder_level : decimal(10,2)
* cost_price : decimal(10,2)
* is_active : tinyint(1)
* created_at : timestamp
* updated_at : timestamp
v face_x_clinic_db reminder_logs
* id : int(11)
* rule_id : int(11)
* treatment_id : int(11)
* patient_id : int(11)
* sent_at : timestamp
* channel_used : enum('email','telegram','both')
* status : enum('sent','failed')
* error_message : text
v face_x_clinic_db reminder_rules
* id : int(11)
* rule_name : varchar(255)
* months_after : tinyint(3) unsigned
* is_active : tinyint(1)
* channels : enum('email','telegram','both')
* telegram_bot_token : varchar(500)
* telegram_chat_id : varchar(255)
* email_recipients : text
* frequency : enum('daily','weekly','monthly')
* send_time : time
* day_of_week : tinyint(3) unsigned
* day_of_month : tinyint(3) unsigned
* filter_doctor_id : int(11)
* filter_service_ids : text
* include_patient_phone : tinyint(1)
* include_patient_email : tinyint(1)
* include_treatment_notes : tinyint(1)
* include_treatment_amount : tinyint(1)
* last_run_at : datetime
* created_at : timestamp
* updated_at : timestamp
v face_x_clinic_db roles
* id : int(11)
* role_name : varchar(50)
* description : text
v face_x_clinic_db services
* id : int(11)
* category_id : int(11)
* service_name : varchar(255)
* description : text
* duration_minutes : int(11)
* price : decimal(10,2)
* product_id : int(11)
* doctor_commission_percentage : decimal(5,2)
* staff_commission_percentage : decimal(5,2)
* is_active : tinyint(1)
* created_at : timestamp
* updated_at : timestamp
v face_x_clinic_db service_categories
* id : int(11)
* name : varchar(100)
* description : text
* created_at : timestamp
* updated_at : timestamp
v face_x_clinic_db settings
* id : int(11)
* setting_key : varchar(100)
* setting_value : text
v face_x_clinic_db stock_movements
* id : int(11)
* product_id : int(11)
* movement_type : enum('Stock In','Stock Out - Treatment','Adjustment +','Adjustment -','Initial','Adjustment + (Item Deleted)','Adjustment - Qty Edit','Adjustment + (Product Changed)')
* quantity_change : decimal(10,2)
* stock_after_move : decimal(10,2)
* related_treatment_item_id : int(11)
* movement_datetime : datetime
* notes : text
* user_id : int(11)
* created_at : timestamp
v face_x_clinic_db treatments
* id : int(11)
* opd_patient_id : int(11)
* doctor_id : int(11)
* appointment_id : int(11)
* treatment_datetime : datetime
* total_amount : decimal(12,2)
* total_doctor_commission : decimal(10,2)
* total_staff_commission : decimal(10,2)
* payment_method : enum('Cash','Credit Card','Bank Transfer','PayPal','Loan','Other')
* payment_method_other : varchar(100)
* payment_status : enum('Unpaid','Partially Paid','Paid')
* invoice_id : int(11)
* amount_paid : decimal(12,2)
* notes : text
* created_at : timestamp
* updated_at : timestamp
* created_by : int(11)
v face_x_clinic_db treatment_items
* id : int(11)
* treatment_id : int(11)
* service_id : int(11)
* item_description : varchar(255)
* quantity : int(11)
* unit_price : decimal(10,2)
* total_price : decimal(10,2)
* doctor_commission_amount : decimal(10,2)
* staff_commission_amount : decimal(10,2)
v face_x_clinic_db treatment_linked_consents
* id : int(11)
* treatment_id : int(11)
* linked_at : timestamp
v face_x_clinic_db users
* id : int(11)
* username : varchar(50)
* password_hash : varchar(255)
* email : varchar(100)
* full_name : varchar(100)
* nickname : varchar(50)
* phone : varchar(20)
* contact_channel : varchar(50)
* role_id : int(11)
* is_active : tinyint(1)
* created_at : timestamp
* updated_at : timestamp
Create relationship
FOREIGN KEY
on delete
on update
Delete relationship