Hi all,
I have a table design problem with the modeling of the dimensions of a work piece (mechanical part).
A work piece can be cylindrical (radius, height) or cuboid (width, length, height). Actually this is modeled like this :
The problem is : for a cylindrical work piece, length and width have no sense (only height and radius). And for a cuboid the radius dimension does not apply.
For now these fields are mixed in the work_piece table, but as explained this leads to incoherences.
The work_piece table is referenced in other tables through its primary key (id).
How would you model things to have a clean design ?
--
Globos
I have a table design problem with the modeling of the dimensions of a work piece (mechanical part).
A work piece can be cylindrical (radius, height) or cuboid (width, length, height). Actually this is modeled like this :
Code:
table work_piece (
id INTEGER,
type INTEGER, -- type = 0 -> cylinder, type = 1 -> cuboid
height REAL,
length REAL,
width REAL,
radius REAL
PRIMARY KEY(id));
For now these fields are mixed in the work_piece table, but as explained this leads to incoherences.
The work_piece table is referenced in other tables through its primary key (id).
How would you model things to have a clean design ?
--
Globos