Ask the experts for questions about database design.

Source: Internet
Author: User
I am a newbie to ask you about database design. recently I am developing a php + mysql-based repair system, and I found that the database structure has a serious error. The main problem occurs in the association between the user table and the web_order table. the uid of the user table's primary key is used as the foreign key of the web_order table. the focus is on asking you about database design.
I am a newbie. I recently developed a php + mysql-based repair reporting system. I found that the database structure has a serious error.




The main problem occurs in the association between the user table and the web_order table. the uid of the user table's primary key is used as the foreign key of the web_order table, the key point is that the w_workid value of the web_order table is also the uid field value of the user table. The reason is that the user permission of my user table is only distinguished by one power field. this system has common users, the maintenance personnel, secretaries, and administrators have four permissions. in the system logic, the maintenance personnel must indicate who reported the repair ticket (User), who repaired the ticket (maintenance personnel), and who assigned the ticket (secretary ), I am not sure how to associate the table or modify the table structure. thank you for your great help. Mysql database
------ Solution --------------------
At the time of repair, the web_order table will have a record
During service, the web_order table will have a record
At the time of allocation, the web_order table also has a record.
Why cannot It be associated?
------ Solution --------------------
Since the secretary assignment and the maintenance personnel receive a ticket are represented by the state field in the update table, no record is added.
So you have no place to record who is operating
As a result, it is naturally impossible to tell who is performing what operations
Can't you find a solution to this simple problem?
------ Solution --------------------
Add an operation log table to record personnel time, operations, and other information.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.