mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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 <archlinux@cryptocrack.de>
This commit is contained in:
parent
8562987552
commit
b7941073ac
6 changed files with 214 additions and 128 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue