I have a schema that I'm trying to normalize:
Component(component_id, component_number, component_revision,...)
Component_lot(component_lot_id, component_lot_number, component_number, component_revision,...)
Component_supplier(component_supplier_id, component_supplier_name, component_number)
Ideally I'd like to get rid of the component_number in both the component_lot and component_supplier tables, as well as the component_revision in the component_lot table, and just use component_id.
The problem is that when the component revision is changed, I have multiple entries in the component table for the same component number, and I have to find a good way to determine which revision is active (it's not a simple 1, 2, 3 numbering system that I can sort by, and it's possible that a new revision could exist but not be active yet). Additionally, if I create a new revision of a component, it gets a new id and now I have to establish the supplier for the new revision of that component in component_supplier.
I've considered making an isActive field in component, but that doesn't seem like an effective solution to the problem. I've also considered keeping component_number as the fk in component_supplier, but there are instances where the component number could change (rare, but possible).
Any advice or links to articles would be appreciated.
Component(component_id, component_number, component_revision,...)
Component_lot(component_lot_id, component_lot_number, component_number, component_revision,...)
Component_supplier(component_supplier_id, component_supplier_name, component_number)
Ideally I'd like to get rid of the component_number in both the component_lot and component_supplier tables, as well as the component_revision in the component_lot table, and just use component_id.
The problem is that when the component revision is changed, I have multiple entries in the component table for the same component number, and I have to find a good way to determine which revision is active (it's not a simple 1, 2, 3 numbering system that I can sort by, and it's possible that a new revision could exist but not be active yet). Additionally, if I create a new revision of a component, it gets a new id and now I have to establish the supplier for the new revision of that component in component_supplier.
I've considered making an isActive field in component, but that doesn't seem like an effective solution to the problem. I've also considered keeping component_number as the fk in component_supplier, but there are instances where the component number could change (rare, but possible).
Any advice or links to articles would be appreciated.