Question

Database schema : relation service_req to company

  • 18 December 2023
  • 2 replies
  • 36 views

Hi,

I have a question regarding the database / table layout.

I have restored the MySQL backup locally but cannot find the link between a Service record and the Company.

So all service records are stored in the table ‘service_req’. 

The customers/companies stored in the table ‘company’. Within this table I was able to find a field called company_id.

 

However in the service_req table I cannot find any field called company_id to link those 2 together.

I already took a look in the SysAid database guide but without any luck (SysAid Database Guide)

 

Someone has the answer ?

Thx


2 replies

Userlevel 1
Badge +1

Hi @christophedv,

The field company_id is correlated to action items, this information can be found in the table sr_sub_tab, sr_sub_tab_history which contains all information regarding action items. There is no differentiation on the DB level between action items for Requests, Changes, and Problems.

The table service_req, service_req_history contains all information regarding service records, excluding action items. Incidents, Requests, Changes, and Problems are all stored in this table using the same fields. These SR types are differentiated by the value in the "sr_type" field.

in the sr_sub_tab, sr_sub_tab_history the company is associated with the action item. Corresponds to the "company_id" in the "company" table

If you need more help, have further questions, or just want to chat about this topic, please don't hesitate to reach out. 

Hi @dragos.baciu 

 

Thank you for your helpfull reply and found out that I don’t have all data in the 2 tables (sr_sub_tab & sr_sub_tab_history). When I query that table, the last data is from 2015.

 

So basically I need sr_sub_tab, sr_sub_tab_history, sr_sub_tab, sr_sub_tab_history. Create the link between those and I’m able to filter on Company name and it will return me a list of service requests for that company. Correct?

 

Reply