Commit graph

90 commits

Author SHA1 Message Date
Dan McGee
c0e6aabeb1 Fix performance issues with new PackageDepends lookups
We do a lookup by DepName in the package details view, but I made the
silly mistake of forgetting this index addition in the upgrade steps.

Lukas: Fix numbering in "UPGRADING".

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-06-25 11:29:52 +02:00
Lukas Fleischer
664303956e Remove obsolete README file in "support/".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-13 12:22:35 +02:00
Lukas Fleischer
2b460a8f2d Remove "NewPkgNotify" column from "Users" table.
We do not require this column anymore. New package notifications are no
longer supported.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-13 12:22:35 +02:00
Lukas Fleischer
d73f9df39b Remove new package notification script.
We discussed this on aur-dev. Everything that depends on tupkgs should
be removed. Those who still want to be notified should move on to the
RSS feed.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-13 12:22:34 +02:00
Lukas Fleischer
31cda618ca Make "gendummydata.py" Python 3 compliant.
* Transform into valid Python 3.x code using 2to3.

* Change shebang from "/usr/bin/python2" to "/usr/bin/python3".

* Invoke with "python3" instead of "python2" in "reloadtestdb.sh".

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-13 12:14:37 +02:00
Lukas Fleischer
e1bf49e03c Fix dependency generation in "gendummydata.py".
Package dependencies are no longer stored as references to the
"Packages" table but kept directly in "PackageDepends", so the dummy
data generation script should be fixed to create package names instead
of references, also. Regression introduced in commit
7c91c59245.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-12 13:03:17 +02:00
Lukas Fleischer
bd78b14cb5 Fix syntax error in "CREATE TABLE" statement in the SQL schema.
Regression introduced in commit
7c91c59245.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-12 13:02:54 +02:00
elij
3d3fed6910 wrap long SQL commands to improve formatting and readability
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-12 11:57:31 +02:00
elij
e08731d24c replace print statements with logging module in gendummydata
use the logging module instead of writing directly to stderr
this makes the code cleaner as it removes the numerous tests for the value
of DBUG, yet allows devs to control the level of output verbosity.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-12 11:57:31 +02:00
elij
2e444a79d5 remove mysql dependency from gendummydata
- remove need to use mysql for escaping the sql -- removing single quote
  should be enough
- instead of using sql to fetch categories from a live database, simply
  consider categories an integer range, specified to the size of that in the
  aur-schema.

Lukas: Add "CATEGORIES_COUNT" initialization. Fix random number range
used in genCategory() (AUTO_INCREMENT columns are 1-based by default,
not 0-based).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-04-12 11:56:32 +02:00
Dan McGee
7c91c59245 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>
2011-04-03 22:59:32 +02:00
Lukas Fleischer
11366b8a1a gendummydata.py: Do not touch output file until we need it.
Ensures there's no leftover (empty) file if something during
initialization fails.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-30 10:27:23 +02:00
Dan McGee
f9eba12312 Ensure users can be deleted when foreign keys are present
This change is necessary to prevent this:
    mysql> delete from Users where ID = 112;
    ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails (`aur`.`Packages`, CONSTRAINT `Packages_ibfk_2` FOREIGN KEY (`SubmitterUID`) REFERENCES `Users` (`ID`) ON DELETE NO ACTION)

As a bonus, due to foreign keys, orphaning of packages will be
automatic.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:14 +01:00
Dan McGee
abd41bbb51 Allow DB connection values to come from the environment
Stop hardcoding everything everywhere for those of us that don't use the
localhost/aur/aur/AUR setup. Also allow for the dummy data to be created
in the reload script if it does not exist. Finally, remove two
assumptions that the AUR database already exists.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:14 +01:00
Dan McGee
b9690972d0 Use a single transaction to write dummy data
This is immensely faster when using InnoDB since we don't need to sync
after each and every INSERT statement.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-03-04 10:29:13 +01:00
Lukas Fleischer
f89ba3fb6d Remove database recreation code from "support/schema/reloadtestdb.sh".
Database is being dropped and recreated in the schema, so there's no
need to do this in "reloadtestdb.sh" as well.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-28 09:45:29 +01:00
Loui Chang
c638a89314 Specify utf8 in database schema.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-28 09:38:14 +01:00
Lukas Fleischer
bc238965cb Fix some minor bugs in "support/schema/gendummydata.py".
The dummy data generation script used to create wrong package IDs for
both "PackageVotes" and "PackageDepends" tables which led to errors when
reloading the test data (constraints failed). This is fixed by no longer
creating entries with zero ("0") package IDs.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 19:46:30 +01:00
Lukas Fleischer
816a0cf8d7 Add "ENGINE = InnoDB" to "CREATE TABLE" statements in the SQL schema.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 19:46:29 +01:00
Lukas Fleischer
1e3fa38de5 Define "Packages.SubmitterUID" and "Packages.MaintainerUID" as "NULL".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 19:46:19 +01:00
Lukas Fleischer
40ccf77ca0 Define "PackageComments.DelUsersID" as "NULL".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-27 16:20:02 +01:00
Lukas Fleischer
ac632980c3 Add missing foreign keys and constraints to the DB.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-26 21:11:25 +01:00
Lukas Fleischer
5905577694 Use VARCHAR instead of CHAR in "PackageBlacklist" table.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-11 14:43:24 +01:00
Lukas Fleischer
b69f548065 Add a package name blacklist.
Can be used to blacklist package names for normal users. TUs and
developers are not affected. This is especially useful if used together
with a cron job that updates the blacklist periodically, e.g. to reject
packages which are available in the binary repos (FS#12902).

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-11 14:43:22 +01:00
Lukas Fleischer
881bfcced4 Remove unused fulltext index from "Packages" table.
Drop fulltext indexes, which prevent the use of InnoDB, from "Packages"
table. All search routines use "LIKE" patterns, so fulltext search has
actually never been used.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-10 08:17:53 +01:00
Lukas Fleischer
6d737c4684 Use VARCHAR instead of CHAR where appropriate.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-09 08:46:27 +01:00
Lukas Fleischer
34ac351e82 Drop "PackageContents" table and references.
We don't even touch source tarballs anymore - except for extracting the
PKGBUILD, so this is no longer needed.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-01 15:16:29 +01:00
Lukas Fleischer
366ea03118 Remove "FSPath" column from "Packages" table.
This field is not used anymore, so drop it from the table and remove all
references.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-01 15:01:56 +01:00
Dan McGee
7f5af61c88 Drop PackageLocations table and references
We don't need this anymore since all packages managed here are
well...managed here. Rip out all of the places we were using this field,
many of which depended on the magic value '2' anyway.

On the display side of things, we had a column that was always showing
'unsupported' that is now gone, and you can no longer sort by this column.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-02-01 12:41:08 +01:00
Lukas Fleischer
737268e0c2 Use "python2" shebang for "newpackage-notify" and "gendummydata.py".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-24 18:12:05 +01:00
Lukas Fleischer
556de318ae Build URLs from package names (fixes FS#15308, FS#19327).
Drop the "URLPath" field from the "Packages" table, build URLs from
package names instead.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
2011-01-24 18:08:29 +01:00
Lukas Fleischer
eda713032c Add timestamp when a package is flagged out-of-date (FS#20848).
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
- resolve conflict and omit i18n changes.
2010-11-10 14:50:35 -05:00
Denis
290c436046 Support for storing salted passwords
To upgrade existing databases:

ALTER TABLE Users ADD Salt CHAR(32) NOT NULL DEFAULT '';

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2010-04-17 16:50:24 -04:00
Loui Chang
c3ebc4d7fa aur-schema.sql: Expand LangPreference field to allow for longer lang codes.
To upgrade existing databases:

  ALTER TABLE Users MODIFY LangPreference CHAR(5) NOT NULL DEFAULT 'en';

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-11-29 06:28:15 -05:00
Evangelos Foutras
861cbf4935 Implement 'Password Reset' facility (FS#3061)
This works by adding a new field to the 'Users' table called 'ResetKey',
which is a 32 characters long, random string. When the user requests a
password reset, a new 'reset key' is generated and sent to the user's
e-mail address in the form of a link in the following format:

  http://aur.archlinux.org/passreset.php?resetkey=<reset key>

When the above link is followed, the user is presented with a form to
verify his/her e-mail address and specify the new desired password. If
the e-mail address matches the reset key in the database, the new
password is assigned to the account. If there is an error, a relevant
message is displayed and the user is prompted to re-enter the required
information. Upon successful completion of this procedure, the ResetKey
field in the database is blanked and the specific key cannot be reused.

One SQL query is needed to add the ResetKey field to the 'Users' table:

  ALTER TABLE `Users` ADD `ResetKey` CHAR(32) NOT NULL DEFAULT '';

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-11-13 16:49:55 -05:00
Dan McGee
e2b3bd1c37 Add multicolumn indexes on votes and notifications tables
To put a long story short, when we do joins on these tables in our
pkg_search_page() function, we always join on both the user ID and package
ID columns. By creating multicolumn indices, we can always get the exact row
we are looking for in the table.

The benefits of adding a unique index should also speak for themselves, as
we previously did not have this on either of these tables.

This is part one of a two-part series to address the fact that this query
was often showing up in our slow query logs.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-06-18 01:47:17 -04:00
Loui Chang
186abc852a Move tupkg scripts to tupkg/scripts.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-11 10:22:15 -05:00
Loui Chang
084b11a6f2 Update usage and paths in tupkg run scripts.
In run-tupkgupdate:
Set HOME for correct CVS auth.
Properly filter out unneeded messages from
CVS output, and prune empty directories on update.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-11 10:20:59 -05:00
Loui Chang
f285da5d57 run-tupkgupdate: Fix CVS output grepping.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-27 19:06:07 -05:00
Loui Chang
460a6ccb46 Rework tupkg support scripts. Update paths.
Grep CVS update output for only useful messages.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-26 23:03:53 -05:00
Loui Chang
90cb026fb8 Remove redundant tupkgs.conf.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-24 02:55:49 -05:00
Loui Chang
cceb66476e Add version, username and description to daily new package email.
Add some variables to make it more configurable.
Do some general clean up on the script.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-06-10 04:25:07 +08:00
Callan Barrett
04dae8d94f 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>
2008-03-27 02:34:35 -05:00
Loui Chang
e64307d8d2 Generate valid dummy data entries
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-23 03:04:17 -05:00
Loui Chang
3577326b2b Make all references to AUR database consistent
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-23 03:04:17 -05:00
Callan Barrett
ce225727f6 Bug in uploading PKGBUILDs and aur schema
This fixes a bug where TUs and devs couldn't upload packages because
the query would have an extra column in it to mark the pkgbuild safe
automatically, guessing it got missed when the safe flags were
removed. Also fixes a screw up I made with the schema file when I
added the tables for the voting app.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:19 -06:00
Callan Barrett
5f4afcc8cb Add support for variable length votes in voting application
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:19 -06:00
Callan Barrett
a8e574ef28 AUR Voting Application
Added support for TU voting through AUR

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:19 -06:00
eliott
c17b629a4d Fix for safe-removal. 2008-01-20 00:21:18 -06:00
eliott
a9837329d6 Hand diff of simo's patch to remove flag safe functionality.
Simo's original commit text:
 The idea of safe flagging is unclear, poorly named, misunderstood,
 and not even used. At the time this patch was created, less than
 a third of the packages in unsupported were flagged safe, and less
 than a tenth of users knew how to interpret it.

 The safe flag has been replaced by a disclaimer on the main page.
2008-01-20 00:21:18 -06:00