| 1 | == Релациско мапирање |
| 2 | |
| 3 | === Ознаки |
| 4 | Примарните клучеви се означени со bold и underline '''__PK__''' |
| 5 | |
| 6 | Надворешните клучеви се означени со '''FK*''' за кои во заграда '''()''' е напишана табелата која ја референцираат. |
| 7 | |
| 8 | Задолжителните атрибути се '''болдирани.''' |
| 9 | |
| 10 | === Табели |
| 11 | 1. User ('''__id__, first_name, last_name, email, password_hash, date_of_birth, rating, address_id*(Address)''', bio) |
| 12 | |
| 13 | 2. Property ('''__id__, title, description, created_at, owner_id*(User), property_type_id* (Property_Type), address_id *(Address)''') |
| 14 | |
| 15 | 3. Property_Type ('''__id__, name''') |
| 16 | |
| 17 | 4. Property_Image ('''__id__, image, property_id*(Property)''') |
| 18 | |
| 19 | 5. Unit ('''__id__, unit_number, floor, bedrooms, bathrooms, area_sq_m, rent_amount, property_id* (Property)''') |
| 20 | |
| 21 | 6. Listing ('''__id__, available_from, available_to, status, '''description''', unit_id* (Unit)''') |
| 22 | |
| 23 | 7. Lease ('''__id__, start_date, end_date, rent_amount, deposit_amount, unit_id * (Unit), tenant_id (Tenant_Profile), landlord_id* (Landlord_Profile)''') |
| 24 | |
| 25 | 8. Payment ('''__id__, amount, status, payment_date, payment, lease_id* (Lease), payment_method_id* (Payment_Method)''') |
| 26 | |
| 27 | 9. Payment_Method ('''__id__, name''') |
| 28 | |
| 29 | 10. Tenant_Profile ('''__id*__(Profile)''') |
| 30 | |
| 31 | 11. Landlord_Profile ('''__id*__(Profile), managed_properties_count, is_agent''') |
| 32 | |
| 33 | 12. Service_Request ('''__id__, decription, request_date, status, lease_id*(Lease), service_category_id * (Service_Category)''') |
| 34 | |
| 35 | 13. Service_Category ('''__id__, name''') |
| 36 | |
| 37 | 14. Maintenance_Log ('''__id__, description, maintenance_date, service_request_id * (Service_Request)''') |
| 38 | |
| 39 | 15. Inspection ('''__id__, inspection_date, notes, lease_id*(Lease), landlord_id*(Landlord_Profile)''') |
| 40 | |
| 41 | 16. Document ('''__id__, file_type, file_url, uploaded_at, user_id * (User), lease_id* (Lease)''') |
| 42 | |
| 43 | 17. Address ('''__id__, street, city, number, country''') |
| 44 | |
| 45 | 18. Message ('''__id__, sent_at, content, from_user_id*(User), to_user_id*(User), lease_id*(Lease)''') |
| 46 | |
| 47 | |
| 48 | === DDL скрипта за бришење на табелите и креирање на табелите |
| 49 | |
| 50 | === DML скрипта за полнење на табелите со податоци |
| 51 | |
| 52 | == Историјат |
| 53 | |