پایگاه داده — تسک ۰۵: ماژول دکتر
جدول: doctors
(entity_type=clinic_pro, bundle=doctor — از DB backup و config تأیید شده)
| ستون |
نوع |
نام Drupal |
توضیح |
| id |
INT UNSIGNED AUTO_INCREMENT PK |
id |
|
| uuid |
CHAR(36) UNIQUE NOT NULL |
uuid |
|
| user_id |
INT FK → users.id UNIQUE NOT NULL |
uid |
کاربر صاحب پروفایل |
| name |
VARCHAR(255) NOT NULL |
field_name |
نام دکتر |
| gender |
VARCHAR(10) NULL |
field_gender |
woman یا man |
| medical_system_code |
VARCHAR(25) NULL |
field_doctor_id |
شماره نظام پزشکی (max 25) |
| mobile_number |
VARCHAR(15) NULL |
field_doctor_mobile_number |
شماره موبایل دکتر (max 15) |
| activity_time |
INT NULL |
field_activity_time |
timestamp سال شروع فعالیت |
| degree |
VARCHAR(30) NULL |
field_degree |
مدرک (مقادیر زیر) |
| info |
LONGTEXT NULL |
field_info |
بیوگرافی |
| image_path |
VARCHAR(255) NULL |
field_image |
تصویر (media) |
| doctor_rate |
FLOAT NULL |
field_doctor_rate |
امتیاز ستارهای (default: 3.5) |
| doctor_rate_percentage |
FLOAT NULL |
field_doctor_rate_percentage |
درصد رضایت (default: 60) |
| active_doctor_appointment |
TINYINT(1) DEFAULT 1 |
field_active_doctor_appointmen |
نوبتدهی فعال (بدون حرف 't') |
| representation_id |
INT FK → representations.id NULL |
field_representation |
entity ref → clinic_pro |
| created_at |
INT NOT NULL |
created |
Unix timestamp |
| updated_at |
INT NOT NULL |
changed |
Unix timestamp |
مقادیر field_degree (از config)
مقادیر field_gender (از config)
جدول: doctor_specialties (ManyToMany pivot)
| ستون |
نوع |
توضیح |
| doctor_id |
INT FK → doctors.id |
|
| category_id |
INT FK → categories.id |
|
| PRIMARY KEY (doctor_id, category_id) |
|
field_specialty → cardinality=2 (حداکثر ۲ تخصص) |
جدول: doctor_services (ManyToMany pivot)
| ستون |
نوع |
توضیح |
| doctor_id |
INT FK → doctors.id |
|
| category_id |
INT FK → categories.id |
|
| PRIMARY KEY (doctor_id, category_id) |
|
field_doctor_services → cardinality=8 (حداکثر ۸ سرویس) |
جدول: doctor_states (ManyToMany pivot)
| ستون |
نوع |
توضیح |
| doctor_id |
INT FK → doctors.id |
|
| category_id |
INT FK → categories.id |
|
| PRIMARY KEY (doctor_id, category_id) |
|
field_state → cardinality=1 |
جدول: doctor_cities (ManyToMany pivot)
| ستون |
نوع |
توضیح |
| doctor_id |
INT FK → doctors.id |
|
| category_id |
INT FK → categories.id |
|
| PRIMARY KEY (doctor_id, category_id) |
|
field_city → cardinality=1 |
جدول: doctor_addresses
(entity_type=clinic_pro, bundle=doctors_addresses — از DB backup)
| ستون |
نوع |
نام Drupal |
توضیح |
| id |
INT UNSIGNED AUTO_INCREMENT PK |
id |
|
| uuid |
CHAR(36) UNIQUE NOT NULL |
uuid |
|
| doctor_id |
INT FK → doctors.id CASCADE |
field_doctor |
دکتر |
| name |
VARCHAR(255) NULL |
field_name |
نام مطب/آدرس |
| address |
LONGTEXT NULL |
field_address |
آدرس کامل |
| telephone |
VARCHAR(50) NULL |
field_telephone |
تلفن مطب |
| latitude |
FLOAT NULL |
field_latitude |
عرض جغرافیایی |
| longitude |
FLOAT NULL |
field_longitude |
طول جغرافیایی |
| created_at |
INT NOT NULL |
created |
Unix timestamp |
| updated_at |
INT NOT NULL |
changed |
Unix timestamp |
جدول: clinics
(entity_type=clinic_pro, bundle=clinic — از config تأیید شده)
| ستون |
نوع |
نام Drupal |
توضیح |
| id |
INT UNSIGNED AUTO_INCREMENT PK |
id |
|
| uuid |
CHAR(36) UNIQUE NOT NULL |
uuid |
|
| user_id |
INT FK → users.id NOT NULL |
uid |
مالک |
| name |
VARCHAR(255) NULL |
field_name |
نام کلینیک |
| info |
LONGTEXT NULL |
field_info |
توضیحات |
| address |
LONGTEXT NULL |
field_address |
آدرس |
| telephone |
VARCHAR(50) NULL |
field_telephone |
تلفن |
| is_24_7 |
TINYINT(1) DEFAULT 0 |
field_24_7 |
باز ۲۴/۷ |
| working_days |
VARCHAR(255) NULL |
field_working_days |
روزهای کاری (متن آزاد، مثال: 'شنبه تا سه شنبه ساعت ۱۲:۲۰') |
| latitude |
FLOAT NULL |
field_latitude |
|
| longitude |
FLOAT NULL |
field_longitude |
|
| city_id |
INT FK → categories.id NULL |
field_city |
|
| state_id |
INT FK → categories.id NULL |
field_state |
|
| representation_id |
INT FK → representations.id NULL |
field_agent |
نماینده کلینیک |
| created_at |
INT NOT NULL |
created |
|
| updated_at |
INT NOT NULL |
changed |
|
جداول pivot مرتبط با clinic:
clinic_doctors (clinic_id, doctor_id) → field_doctors (cardinality نامحدود)
clinic_specialties (clinic_id, category_id) → field_clinic_specialty
clinic_services (clinic_id, category_id) → field_doctor_services
clinic_insurances (clinic_id, category_id) → field_insurance
جدول: doctor_secretaries
(entity_type=clinic_pro, bundle=doctor_secretary — از config تأیید شده)
| ستون |
نوع |
نام Drupal |
توضیح |
| id |
INT UNSIGNED AUTO_INCREMENT PK |
id |
|
| uuid |
CHAR(36) UNIQUE NOT NULL |
uuid |
|
| user_id |
INT FK → users.id NOT NULL |
uid |
|
| doctor_id |
INT FK → doctors.id NOT NULL |
field_doctor |
entity ref → clinic_pro/doctor |
| secretary_id |
INT FK → users.id NOT NULL |
field_secretary |
entity ref → user (منشی) |
| telephone |
VARCHAR(50) NULL |
field_telephone |
تلفن |
| permission |
LONGTEXT NULL |
field_permission |
مجوزها (JSON) |
| active |
TINYINT(1) DEFAULT 1 |
field_active |
فعال/غیرفعال |
| created_at |
INT NOT NULL |
created |
|
| updated_at |
INT NOT NULL |
changed |
|
ایندکسها
نمونه داده واقعی از DB (clinic_pro table)
روابط کامل clinic_pro entity
doctors → users (ManyToOne, UNIQUE → OneToOne)
doctors → representations (ManyToOne)
doctors ↔ categories (ManyToMany: specialties, services, states, cities)
doctor_addresses → doctors (ManyToOne, CASCADE)
clinics → users (ManyToOne)
clinics ↔ doctors (ManyToMany)
clinics ↔ categories (ManyToMany)
doctor_secretaries → doctors (ManyToOne)
doctor_secretaries → users as secretary (ManyToOne)