Remove references to AURMaintainerUID

This (should) get rid of anything to do with the unused column AURMaintainerUID
in the scripts and schema files

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
This commit is contained in:
Callan Barrett 2008-03-26 22:52:15 +09:00 committed by Simo Leone
parent 7d7ef9b112
commit 04dae8d94f
5 changed files with 81 additions and 115 deletions

View file

@ -122,7 +122,6 @@ CREATE TABLE Packages (
ModifiedTS BIGINT UNSIGNED NOT NULL, ModifiedTS BIGINT UNSIGNED NOT NULL,
SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted it? SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted it?
MaintainerUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- User MaintainerUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- User
AURMaintainerUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- TU/Dev
FULLTEXT (Name,Description), FULLTEXT (Name,Description),
PRIMARY KEY (ID), PRIMARY KEY (ID),
UNIQUE (Name), UNIQUE (Name),
@ -133,12 +132,10 @@ CREATE TABLE Packages (
INDEX (NumVotes), INDEX (NumVotes),
INDEX (SubmitterUID), INDEX (SubmitterUID),
INDEX (MaintainerUID), INDEX (MaintainerUID),
INDEX (AURMaintainerUID),
FOREIGN KEY (CategoryID) REFERENCES PackageCategories(ID) ON DELETE NO ACTION, FOREIGN KEY (CategoryID) REFERENCES PackageCategories(ID) ON DELETE NO ACTION,
FOREIGN KEY (LocationID) REFERENCES PackageLocations(ID) ON DELETE NO ACTION, FOREIGN KEY (LocationID) REFERENCES PackageLocations(ID) ON DELETE NO ACTION,
FOREIGN KEY (SubmitterUID) REFERENCES Users(ID) ON DELETE NO ACTION, FOREIGN KEY (SubmitterUID) REFERENCES Users(ID) ON DELETE NO ACTION,
FOREIGN KEY (MaintainerUID) REFERENCES Users(ID) ON DELETE NO ACTION, FOREIGN KEY (MaintainerUID) REFERENCES Users(ID) ON DELETE NO ACTION
FOREIGN KEY (AURMaintainerUID) REFERENCES Users(ID) ON DELETE NO ACTION
); );

View file

@ -249,8 +249,8 @@ for p in seen_pkgs.keys():
uuid = genUID() # the submitter/user uuid = genUID() # the submitter/user
s = "INSERT INTO Packages (ID, Name, Version, CategoryID, LocationID, SubmittedTS, SubmitterUID, MaintainerUID, AURMaintainerUID) VALUES (%d, '%s', '%s', %d, %d, %d, %d, %d, %d);\n" % (seen_pkgs[p], p, genVersion(location_id), s = "INSERT INTO Packages (ID, Name, Version, CategoryID, LocationID, SubmittedTS, SubmitterUID, MaintainerUID) VALUES (%d, '%s', '%s', %d, %d, %d, %d, %d);\n" % (seen_pkgs[p], p, genVersion(location_id),
genCategory(), location_id, NOW, uuid, muid, muid) genCategory(), location_id, NOW, uuid, muid)
out.write(s) out.write(s)
if count % 100 == 0: if count % 100 == 0:
if DBUG: print ".", if DBUG: print ".",

View file

@ -159,17 +159,8 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) {
$disown .= ", ".$pid; $disown .= ", ".$pid;
} }
} }
# Removed for now since we will have 1 maintainer
# PJM - 5 April 2005
# if ($atype == "Trusted User" || $atype == "Developer") {
# $field = "AURMaintainerUID";
# } elseif ($atype == "User") {
# $field = "MaintainerUID";
# } else {
# $field = "";
# }
$field = "MaintainerUID"; $field = "MaintainerUID";
if ($field) {
$q = "UPDATE Packages "; $q = "UPDATE Packages ";
$q.= "SET ".$field." = 0 "; $q.= "SET ".$field." = 0 ";
$q.= "WHERE ID IN (" . $disown . ") "; $q.= "WHERE ID IN (" . $disown . ") ";
@ -178,7 +169,6 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) {
$q.= "AND ".$field." = ".uid_from_sid($_COOKIE["AURSID"]); $q.= "AND ".$field." = ".uid_from_sid($_COOKIE["AURSID"]);
} }
db_query($q, $dbh); db_query($q, $dbh);
}
print "<p>\n"; print "<p>\n";
print __("The selected packages have been disowned."); print __("The selected packages have been disowned.");
@ -214,15 +204,9 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) {
$delete .= ", ".$pid; $delete .= ", ".$pid;
} }
} }
# if ($atype == "Trusted User" || $atype == "Developer") {
# $field = "AURMaintainerUID";
# } elseif ($atype == "User") {
# $field = "MaintainerUID";
# } else {
# $field = "";
# }
$field = "MaintainerUID"; $field = "MaintainerUID";
if ($field) {
# Only grab Unsupported packages that "we" own or are not owned at all # Only grab Unsupported packages that "we" own or are not owned at all
# #
$ids_to_delete = array(); $ids_to_delete = array();
@ -275,11 +259,6 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) {
$q = "DELETE FROM CommentNotify WHERE PkgID = " . $id; $q = "DELETE FROM CommentNotify WHERE PkgID = " . $id;
$result = db_query($q, $dbh); $result = db_query($q, $dbh);
# TODO question: Now that the package as been deleted, does
# the unsupported repo need to be regenerated?
# ANSWER: No, there is no actual repo for unsupported, so no worries! (PJM)
# TODO question: What about regenerating the AUR repo? (EJ)
# Print the success message # Print the success message
print "<p>\n"; print "<p>\n";
print __("The selected packages have been deleted."); print __("The selected packages have been deleted.");
@ -290,7 +269,6 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) {
print __("None of the selected packages could be deleted."); print __("None of the selected packages could be deleted.");
print "</p>\n"; print "</p>\n";
} # end if (!empty($ids_to_delete)) } # end if (!empty($ids_to_delete))
} # end if ($field)
} else { } else {
print "<p>\n"; print "<p>\n";
print __("You did not select any packages to delete."); print __("You did not select any packages to delete.");
@ -320,15 +298,8 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) {
$adopt .= ", ".$pid; $adopt .= ", ".$pid;
} }
} }
# if ($atype == "Trusted User" || $atype == "Developer") {
# $field = "AURMaintainerUID";
# } elseif ($atype == "User") {
#$field = "MaintainerUID";
#} else {
# $field = "";
# }
$field = "MaintainerUID"; $field = "MaintainerUID";
if ($field) {
# NOTE: Only "orphaned" packages can be adopted at a particular # NOTE: Only "orphaned" packages can be adopted at a particular
# user class (TU/Dev or User). # user class (TU/Dev or User).
# #
@ -343,7 +314,6 @@ if ($_POST['action'] == "do_Flag" || isset($_POST['do_Flag'])) {
$q.= " AND LocationID = 2"; $q.= " AND LocationID = 2";
} }
db_query($q, $dbh); db_query($q, $dbh);
}
print "<p>\n"; print "<p>\n";
print __("The selected packages have been adopted."); print __("The selected packages have been adopted.");

View file

@ -90,4 +90,3 @@ $_t["en"]["Developer"] = "Developer";
$_t["en"]["View this user's packages"] = "View this user's packages"; $_t["en"]["View this user's packages"] = "View this user's packages";
?> ?>

View file

@ -500,7 +500,7 @@ function package_details($id=0, $SID="") {
echo " value='".__("Unflag Out-of-date")."'>\n"; echo " value='".__("Unflag Out-of-date")."'>\n";
} }
if ($row["AURMaintainerUID"] == 0 && $row["MaintainerUID"] == 0) { if ($row["MaintainerUID"] == 0) {
echo "<input type='submit' class='button' name='do_Adopt'"; echo "<input type='submit' class='button' name='do_Adopt'";
echo " value='".__("Adopt Packages")."'>\n"; echo " value='".__("Adopt Packages")."'>\n";
} }