Answer the question
In order to leave comments, you need to log in
Would you criticize the logic of my Warehouse database for MySQL (screenshots and MySQLWrkBnch model under the cut)?
Model on the screenshot:
Model for those who want to feel in MySQLWorkbench:
redirect to cyberforum
Tables user and rule will be used for access control.
In general, I plan to write a client in c # vs forms.
Answer the question
In order to leave comments, you need to log in
Zelim Beltoev : chose the second approach, it is rational. I thought about a single table for invoices. I have two types of them - receipt and requirement-invoice. Both types of invoices have the following attributes in common:
- worker_id: who issued
the invoice - unit_id: in which warehouse the invoice was issued
- type_id: incoming/receipt invoice
- lot_id: quantity and type of goods of the goods being issued/consumed
And there are also problems in logic.
According to the worker and the unit, you can easily determine in:
- the incoming invoice, where the goods came
from
- the requirement-invoice, where the goods left from
Now everything looks like this (clickable):
What if you need in:
- the requirement-consignment note, WHERE did the goods go?
So far, I see a solution to the problem in the following: in the "Invoice" table, remove the ID_Unit field (it is inherited from the Worker table), add two fields ID_from, ID_where - these two new fields are linked to the Administrative unit table. It seems ok, but I haven’t done double bonds more than once, and again, some kind of collective farm, even when I tried to make it a reality, the workbench fell
From what catches your eye:
1. The " rule " table - what will you do when new privileges appear? For example, " write_employee ". Add new column?
It would be much more logical to split it into two tables:
rules (id, rule, description)
user_rules (user_id, rule_id)
building (id, name, address, phone, type_id)
building_types (id, name)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question