From b7941073acec76e5b4f89648aca1413c15eb067f Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 4 Apr 2014 00:01:44 +0200 Subject: Add provisional support for package bases This adds a PackageBases table to the database schema and moves the following fields from the Packages table to PackageBases: * CategoryID * NumVotes * OutOfDateTS * SubmittedTS * ModifiedTS * SubmitterUID * MaintainerUID It also fixes all database accesses to comply with the new layout. Having a separate PackageBases table is the first step to split package support. By now, we create one PackageBases entry per package (where the package base has the same name as the corresponding package). When adding full support for split packages later, the package base name will be derived from the pkgbase variable and a single package base will be shared amongst all packages built from one source package. Signed-off-by: Lukas Fleischer --- web/lib/aur.inc.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'web/lib/aur.inc.php') diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index b3a800c5..e786e507 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -292,11 +292,11 @@ function html_footer($ver="") { * * @return int 0 if the user can't submit, 1 if the user can submit */ -function can_submit_pkg($name="", $sid="") { +function can_submit_pkgbase($name="", $sid="") { if (!$name || !$sid) {return 0;} $dbh = DB::connect(); $q = "SELECT MaintainerUID "; - $q.= "FROM Packages WHERE Name = " . $dbh->quote($name); + $q.= "FROM PackageBases WHERE Name = " . $dbh->quote($name); $result = $dbh->query($q); $row = $result->fetch(PDO::FETCH_NUM); @@ -530,17 +530,6 @@ function end_atomic_commit() { $dbh->commit(); } -/** - * - * Determine the row ID for the most recently insterted row - * - * @return string The ID of the last inserted row - */ -function last_insert_id() { - $dbh = DB::connect(); - return $dbh->lastInsertId(); -} - /** * Determine package information for latest package * -- cgit v1.2.3-24-g4f1b