I have doubts about the structure of the table, and I wonder if there is a better approach.
I have a small database for version control repositories (e.g. SVN), packages (e.g. RPM for Linux) built from them, and versions (e.g. 1.2.3-4). This repository cannot create packages or several, but if there is more than one for a given repository, then the specific version for this repository will indicate one "tag" of the code base.
A particular version of "string" can be used to mark the version of the source code in several repositories, but there can be no connection between "1.0" for two different repositories. Therefore, if packages P and Q both come from repo R, then P 1.0 and Q 1.0 are built from tag 1.0 of repo R. But if package X comes from repo Y, then X 1.0 is not related to P 1.0.
In my (simplified) model, I have the following tables (the x_id columns are automatically incrementing surrogate keys, you can pretend that I use a different primary key, if you want, this is not very important):
repository
- repository_id
- repository_name (unique)
...
version
- version_id
- version_string (unique for a particular repository)
- repository_id
...
package
- package_id
- package_name (unique)
- repository_id
...
, , : , repository_id. , , , , . :
package_version
- version_id
- package_id
- package_version_released
...
, , , "promotion_level" - .
, , version_id package_id ... repository_id. /. - , ...
... , -. - , ? , . , ( ) , , ... , , .
, : ?