[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [GSoC] blends-gen-control hints (Was: blends-dev, gsoc 2013)



Hello Andreas,


On Mon, Jul 29, 2013 at 3:58 PM, Andreas Tille <andreas@an3as.eu> wrote:

Hmmmm, your assumption is correct however, IMHO this is a bug inside the
database layout / data import.  We should set according constraints and
fix the import to prevent this.

 I looked again at the udd/setup.sql I realised that we forgot to add primary key pair for the blends_dependencies_alternatives. The primary key definition also includes the unique pair constraint which is what we need at this case. so instead of having something like UNIQUE(blend, task, alternatives) we just add the primary key pair(as you have done in blends_dependencies).

diff --git a/sql/setup.sql b/sql/setup.sql
index a6e7ab8..d992cff 100644
--- a/sql/setup.sql
+++ b/sql/setup.sql
@@ -1818,7 +1818,8 @@ CREATE TABLE blends_dependencies_alternatives (
      dependency         CHARACTER(1) CHECK (dependency IN ('d', 'i', 'r', 's', 'a')), -- Depends / Ignore / Recommends / Suggests / Avoid
      distribution       TEXT CHECK (distribution IN ('debian', 'new', 'prospective', 'ubuntu', 'other')),
      component          TEXT CHECK (component IN ('main', 'main/debian-installer', 'contrib', 'non-free', 'universe', 'multiverse', 'restricted', 'local')),
-     contains_provides  BOOLEAN  -- true if alternatives contain a virtual package
+     contains_provides  BOOLEAN,  -- true if alternatives contain a virtual package
+     PRIMARY KEY (blend, task, alternatives)
 );


That way there won't be duplicated packages as it happens in your local UDD copy.


Kind regards

Emmanouil
 


Reply to: