From 8b52c00a3dc7a1a6fe85d956c105523abf6879e7 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 31 May 2009 10:05:20 +0200 Subject: [PATCH] entropy.db: fix neededlibraryidpackages sql --- libraries/entropy/db.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/entropy/db.py b/libraries/entropy/db.py index 6017dfc6c..645c060b6 100644 --- a/libraries/entropy/db.py +++ b/libraries/entropy/db.py @@ -289,8 +289,7 @@ class Schema: CREATE TABLE neededlibraryidpackages ( idpackage INTEGER, library VARCHAR, - elfclass INTEGER, - PRIMARY KEY(library,elfclass) + elfclass INTEGER ); CREATE TABLE treeupdates ( @@ -4256,6 +4255,8 @@ class LocalRepository: ON neededlibraryidpackages ( library ); CREATE INDEX IF NOT EXISTS neededlibidpackages_idpackage ON neededlibraryidpackages ( idpackage ); + CREATE INDEX IF NOT EXISTS neededlibidpackages_lib_elf + ON neededlibraryidpackages ( library, elfclass ); """) except self.dbapi2.OperationalError: pass @@ -4424,6 +4425,7 @@ class LocalRepository: """) def regenerateCountersTable(self, vdb_path, output = False): + # this is necessary now, counters table should be empty self.cursor.execute("DELETE FROM counters;") # assign a counter to an idpackage @@ -4523,8 +4525,7 @@ class LocalRepository: CREATE TABLE neededlibraryidpackages ( idpackage INTEGER, library VARCHAR, - elfclass INTEGER, - PRIMARY KEY(library,elfclass) + elfclass INTEGER ); """)