diff --git a/database/models.go b/database/models.go index 4c1d0905..58015011 100644 --- a/database/models.go +++ b/database/models.go @@ -165,6 +165,12 @@ type Feature struct { Name string Version string VersionFormat string + + // Parent feature indicates that the vulnerability affects parent feature + // will also affect this feature. + // + // e.g. A source package is the parent feature of a binary package. + Parent *Feature } // NamespacedFeature is a feature with determined namespace and can be affected diff --git a/database/pgsql/testutil.go b/database/pgsql/testutil.go index 1561e59d..7f71bf15 100644 --- a/database/pgsql/testutil.go +++ b/database/pgsql/testutil.go @@ -26,10 +26,10 @@ import ( // int keys must be the consistent with the database ID. var ( realFeatures = map[int]database.Feature{ - 1: {"ourchat", "0.5", "dpkg"}, - 2: {"openssl", "1.0", "dpkg"}, - 3: {"openssl", "2.0", "dpkg"}, - 4: {"fake", "2.0", "rpm"}, + 1: {"ourchat", "0.5", "dpkg", nil}, + 2: {"openssl", "1.0", "dpkg", nil}, + 3: {"openssl", "2.0", "dpkg", nil}, + 4: {"fake", "2.0", "rpm", nil}, } realNamespaces = map[int]database.Namespace{