diff options
author | Dan McGee <dan@archlinux.org> | 2011-03-30 20:48:09 -0500 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-04-03 22:59:32 +0200 |
commit | 7c91c592458b7532806ef75fe09146f82f085f3b (patch) | |
tree | b2fa71032464ec0f2c3fe286c3bd629d18b6fa4f /support | |
parent | 1f252eba64acf18719bd514a7a4464ca18f4c1cb (diff) | |
download | aurweb-7c91c592458b7532806ef75fe09146f82f085f3b.tar.xz |
Remove Dummy Package concept
Instead, we just store dependencies directly in the PackageDepends
table. Since we don't use this info anywhere besides the package details
page, there is little value in precalculating what is in the AUR vs.
what is not.
An upgrade path is provided via several SQL statements in the UPGRADING
document. There should be no user-visible change from this, but the DB
schema gets a bit more sane and we no longer have loads of junk packages
in our tables that are never shown to the end user. This should also
help the MySQL query planner in several cases as we no longer have to be
careful to exclude dummy packages on every query.
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'support')
-rw-r--r-- | support/schema/aur-schema.sql | 5 | ||||
-rwxr-xr-x | support/scripts/newpackage-notify | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql index 8226b18..d8c8560 100644 --- a/support/schema/aur-schema.sql +++ b/support/schema/aur-schema.sql @@ -98,7 +98,6 @@ CREATE TABLE Packages ( CategoryID TINYINT UNSIGNED NOT NULL DEFAULT 1, Description VARCHAR(255) NOT NULL DEFAULT "An Arch Package", URL VARCHAR(255) NOT NULL DEFAULT "http://www.archlinux.org", - DummyPkg TINYINT UNSIGNED NOT NULL DEFAULT 0, -- 1=>dummy License VARCHAR(40) NOT NULL DEFAULT '', NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0, OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL, @@ -109,7 +108,6 @@ CREATE TABLE Packages ( PRIMARY KEY (ID), UNIQUE (Name), INDEX (CategoryID), - INDEX (DummyPkg), INDEX (NumVotes), INDEX (SubmitterUID), INDEX (MaintainerUID), @@ -124,11 +122,10 @@ CREATE TABLE Packages ( -- CREATE TABLE PackageDepends ( PackageID INTEGER UNSIGNED NOT NULL, - DepPkgID INTEGER UNSIGNED NOT NULL, + DepName VARCHAR(64) NOT NULL, DepCondition VARCHAR(20), INDEX (PackageID), FOREIGN KEY (PackageID) REFERENCES Packages(ID) ON DELETE CASCADE, - FOREIGN KEY (DepPkgID) REFERENCES Packages(ID) ON DELETE CASCADE ) ENGINE = InnoDB; diff --git a/support/scripts/newpackage-notify b/support/scripts/newpackage-notify index 66cb45c..9afee07 100755 --- a/support/scripts/newpackage-notify +++ b/support/scripts/newpackage-notify @@ -40,7 +40,7 @@ q = dbconnection.cursor() q.execute("SELECT Packages.Name, Packages.Version, Packages.ID, " "Packages.Description, Users.Username FROM Packages, Users " - "WHERE SubmittedTS >= %d AND DummyPkg = 0 AND " + "WHERE SubmittedTS >= %d AND " "Packages.SubmitterUID = Users.ID" % starttime) packages = q.fetchall() |