sqlite - SQL - row that is a combination of rows in another table -


I have a system in which many software is running. Let's say that the system extends a pizza for cooking from 0. The following sub-systems are:

  1. Method: Selects the selected content.
  2. Ingredient Mr.: The material spreads on the dough.
  3. Oven: Pizza makes it with specific temperatures.

Each of these subsystem runs an independent software that can be upgraded independently. For each pizza, we need to know the various software used to make it. For example, Pizza N ° X, Recipe Wizard v1.0, Component Mixer v2.3, Oven v1.1

I have done the following (simplified):

  Make Table Table (ignore id_pizza not the original primary key, something unknowingly, ...,);  

A software has properties in this table, there may be several versions of a software, but with a different version or modification. This allows me to know which software is installed throughout the system.

  Make Table Software Properties (ID_ Software Software), Tap Primary Key Faucet, Name VARCHAR (16) Faucet, Version INTEGER NULL, Revision INTEGER NULL);  

Modification of a software (as SVN is in modification) often wants to change (developer 2-3 times per day) for testing purposes.

The last table is as follows:

  is not created if the software version (id_softwareVersion is not present, the faucet is not the primary key, fk_pizza INTEGER is not zero, fk_RecipeWizard INTEGER zero, fk_IngredientMixer INTEGER not null, not fk_Oven INTEGER zero barrier c_01_softwareVersion foreign key (fk_pizza) reference Pizza (id_pizza) barrier c_02_softwareVersion foreign key (fk_RecipeWizard) rEFERENCES softwareProperties (id_softwareProperties) barrier c_03_softwareVersion foreign key (fk_IngredientMixer) rEFERENCES softwareProperties (id_softwareProperties ) Handicap c_04_softwareVersion Refer to foreign key (fk_Oven) reference softwareProperties (id_softwareProperties);  

Do you have a better way of doing this instead of having multiple foreign keys? PS: I know that you get a better title for the question.

Many people have seen many relationships, obviously, Have to be removed.

  does not exist in the software version (Fax_Page is not exclusively, fk_softwareProperties is not INTEGER, contract c_01_softwareVersion primary key (fk_pizza, Fk_softwareProperties), CONSTRAINT c_02_softwareVersion foreign key (fk_pizza) reference pizza (id_pizza) Contract c_03_softwareversion Foreign key (fk_softwareProperties) Reference Software Properties (ID_Software Properties); The problem is that, for each pizza, this table will contain several lines, because there are special software in this situation, there will be 3 rows for each pizza. 

Therefore, in the ideal condition there will be 1 pizza, 1 line in the junction table, this line will be a unique group of software. Is there a design pattern for this?


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -