Changes between Version 10 and Version 11 of LogicalAndPhysicalDesign
- Timestamp:
- 12/21/25 23:39:02 (7 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LogicalAndPhysicalDesign
v10 v11 15 15 16 16 {{{VET CLINICS}}} 17 * VetClinic(clinic_id [PK], name, email, phone, city, address, approved_by [FK→Admin(user_id)])17 * !VetClinic(clinic_id [PK], name, email, phone, city, address, approved_by [FK→Admin(user_id)]) 18 18 19 19 {{{ANIMALS}}} … … 23 23 * Listing(listing_id [PK], owner_id [FK→Owner(user_id)], animal_id [FK→Animal(animal_id)], status, price, description, created_at) 24 24 {{{APPOINTMENTS}}} 25 * Appointment(appointment_id [PK], clinic_id [FK→ VetClinic(clinic_id)], animal_id [FK→Animal(animal_id)], responsible_owner_id [FK→Owner(user_id)], status, date_time, notes)25 * Appointment(appointment_id [PK], clinic_id [FK→!VetClinic(clinic_id)], animal_id [FK→Animal(animal_id)], responsible_owner_id [FK→Owner(user_id)], status, date_time, notes) 26 26 {{{REVIEWS (SUPERTYPE + SUBTYPES)}}} 27 27 * Review(review_id [PK], reviewer_id [FK→Client(user_id)], rating, comment, created_at) 28 * UserReview(review_id [PK, FK→Review(review_id)], target_user_id [FK→Users(user_id)])29 * ClinicReview(review_id [PK, FK→Review(review_id)], target_clinic_id [FK→VetClinic(clinic_id)])28 * !UserReview(review_id [PK, FK→Review(review_id)], target_user_id [FK→Users(user_id)]) 29 * !ClinicReview(review_id [PK, FK→Review(review_id)], target_clinic_id [FK→!VetClinic(clinic_id)]) 30 30 {{{HEALTH RECORDS}}} 31 * HealthRecord(healthrecord_id [PK], animal_id [FK→Animal(animal_id)], appointment_id [FK→Appointment(appointment_id)], type, description, date)31 * !HealthRecord(healthrecord_id [PK], animal_id [FK→Animal(animal_id)], appointment_id [FK→Appointment(appointment_id)], type, description, date) 32 32 ---- 33 33 Business rules enforced in DDL: … … 35 35 Review rating range (1–5) 36 36 [[BR]] 37 Disjoint review specialization (a Review can be either UserReview orClinicReview, not both) via trigger37 Disjoint review specialization (a Review can be either !UserReview or !ClinicReview, not both) via trigger 38 38 [[BR]] 39 39 Clinic review constraint: reviewer must have at least one DONE appointment at that clinic (via trigger) 40 40 [[BR]] 41 HealthRecord consistency: its animal_id must match appointment.animal_id (via trigger)41 !HealthRecord consistency: its animal_id must match appointment.animal_id (via trigger) 42 42 == DDL 43 43 * [attachment:schema_creation.sql]
