= Логички и физички дизајн == Релациска шема Релациската шема ја направивме со мапирачка трансформација. || **Ознаки** || **Значење** || || bold || not null|| || underline || primary key || || * || foreign key || === Ентитети User (__**id_user**__, **date_created_user**, **name_user**, **email_user**, **password_user**, telephone_user) * user е резервиран збор во PostgreSQL па оваа табела ќе се вика user_table наместо user Surendee (__**id_user***__''(user)'') Admin (__**id_user***__''(user)'') * admin е резервиран збор во PostgreSQL па оваа табела ќе се вика admin_table наместо admin Donor (__**id_user***__''(user)'', **is_from_organisation**, name_organisation_donor) Organisation (__**id_organisation**__, **name_organisation**, **email_organisation**, **billing_information**) Shelter (__**id_shelter**__, **address_shelter**, **telephone_shelter**, id_organisation, **name_shelter**, **email_shelter**) * атрибутот id_organisation ја претставува 1-М релацијата shelter_is_from_organisation Employee (__**id_user***__''(user)'', **position_employee**, **id_shelter**) * position е резервиран збор во PostgreSQL па оваа колона ќе се вика position_employee наместо position * атрибутот id_shelter ја претставува 1-М релацијата еmployee_works_at_shelter Adopter (__**id_user***__''(user)'', free_time, funds, has_other_pets, has_kids, housing, physical_activity_adopters, will_foster, **is_verified**, verified_by_employee) * атрибутот verified_by_employee ја претставува 1-М релацијата employee_verifies_adopter Adoption (__**id_adoption**__, **start_date**, end_date_foster, **id_adopter**) * атрибутот id_adopter ја претставува 1-М релацијата adopters_want_adoptions Pet (__**id_pet**__, url_pet_image, **age_group**, **size_pet**, breed, name_pet, **species**, **gender**, **can_be_fostered**, id_adoption, id_shelter) * size е резервиран збор во PostgreSQL па оваа колона ќе се вика size_pet наместо size * атрибутот id_adoption ја претставува 1-М релацијата adoptions_for_pets * атрибутот id_shelter ја претставува 1-М релацијата pet_is_in_shelter Post (__**id_post**__, **date_post**, url_thumbanail, id_surendee, id_employee) * ограничување: Post мора да биде во точно една од релациите surrendees_publishes_and_manages_posts или employee_publishes_and_manages_post, не смее да не биде во ниту една или пак во двете * атрибутот id_surendee ја претставува 1-М релацијата surrendees_publishes_and_manages_posts * атрибутот id_employee ја претставува 1-М релацијата employee_publishes_and_manages_post Category (__**id_category**__, **name_category**) Food (__**id_food**__, **manufacturer**, **name_food**, **type_food**) Therapy (__**id_therapy**__, **health_problem**, start_date, end_date) VetClinic (__**id_vet_clinic**__, **telephone_vet_clinic**, **address_vet_clinic**, **name_vet_clinic**) === Слаби Ентитети PersonalProfile (__**id_pet***__(pet), **friendly_to_kids**, **friendly_to_pets**, **attention**, **physical_activity**, **grooming_needed**) === М-М Релации donor_donates_to_organisation (__**id_user***__''(donor)'', __**id_organisation***__''(organisation)'') pet_belongs_to_category (__**id_pet***__''(pet)'', __**id_category***__''(category)'') pet_needs_therapy (__**id_pet***__''(pet)'', __**id_therapy***__''(therapy)'') pet_preferably_eats_food (__**id_pet***__''(pet)'', __**id_food***__''(food)'', **quantity_a_day**) pet_needs_intervention_in_vet_clinic (__**id_pet***__''(pet)'', __**id_vet_clinic***__''(vetClinic)'', **date_of_interventing**, description) == DML скрипти === Скрипта за креирање на табелите '''[attachment:kreiranje.sql]''' === Скрипта за полнење на табелите со податоци '''[attachment:polnenje.sql]''' === Скрипта за бришење на табелите '''[attachment:brishenje.sql]''' == Релациски дијаграм [[Image(dbeaver_er_diagram.png, 100%, center)]] [https://develop.finki.ukim.mk/projects/PAW5/wiki/WikiStart Назад кон почетна]