summaryrefslogtreecommitdiffstats
path: root/lib/sql
Commit message (Collapse)AuthorAgeFilesLines
* migration: Add cleanup-people migration scriptJeremy Kerr2014-05-081-0/+7
| | | | | | | Now that we only create Person object once the User has been confirmed, we can clean up unused Person objects from the database. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/sql: remove references to auth_message modelJeremy Kerr2014-04-221-2/+0
| | | | | | The Message model was deprecated in 1.4, and removed in 1.6 Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/sql/migration: Fix column names for MySQL/MariaDBRalf Baechle2013-10-131-3/+3
| | | | | | | | | | | | | | | | | The first issue is that patchwork was no longer accepting new patches via the apps/patchwork/bin/parsemail.sh script. When I was trying to invoke it manually, it only printed "no project found". I was able to figure out that this was caused by changes to the database scheme which are taken care of by the two SQL scripts: lib/sql/migration/012-project-add-columns.sql lib/sql/migration/013-bundle-names.sql The catch - these first script don't run with MySQL - or rather MariaDB that Fedora has switched to. MariaDB doesn't like the quotes around the table and column names. Patch below. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* sql: remove non-existing auth_message tableFlorian Fainelli2013-10-041-1/+0
| | | | | | | | During a recent installation the grant-all MySQL script was erroring out because the "auth_message" table does not exist, remove it. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* sql: update grant-all.mysql.sqlFlorian Fainelli2013-10-041-1/+1
| | | | | | | | The MySQL grant all script has a typo on the table "patchwork_bundle_patches" vs "patchwork_bundlepatch" update that. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* bundles: Don't allow slashes in bundle namesJeremy Kerr2013-04-201-0/+6
| | | | | | | | Because bundle names are used in URLs, we don't want slashes in them. Include a SQL migration script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add URL and SCM data to projectsSimo Sorce2012-11-151-0/+5
| | | | | | | | | | | | | | | This allows us to display friendly links to the project website, web SCM UI and SCM URL. For example for the patchwork project these could be set to: web_url: http://jk.ozlabs.org/projects/patchwork/ scm_url: git://ozlabs.org/home/jk/git/patchwork webscm_url: http://git.ozlabs.org/?p=patchwork;a=tree Requires a DB schema upgrade Signed-off-by: Simo Sorce <idra@samba.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Fix grant scriptSimo Sorce2012-10-251-2/+1
| | | | | | | | patchwork_patchchangenotification_id_seq does not exist, so running this script simply fails with a rollback Signed-off-by: Simo Sorce <idra@samba.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* sql: remove development migration scriptJeremy Kerr2011-12-081-22/+0
| | | | | | | The projectmaintainer heirachy hasn't been implemented, so we don't need the migration script yet. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: Add PatchChangeNotification and record patch state changesJeremy Kerr2011-04-143-2/+17
| | | | | | | | | Add a PatchChangeNotification model to keep track of changes to a patch's state. Hook this up to Patch's pre_save signal. Requires a DB schema upgrade. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add email opt-out systemJeremy Kerr2011-04-143-1/+8
| | | | | | | | | | | We're going to start generating emails on patchwork updates, so firstly allow people to opt-out of all patchwork communications. We do this with a 'mail settings' interface, allowing non-registered users to set preferences on their email address. Logged-in users can do this through the user profile view. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* registration: use EmailConfimation rather than separate registration appJeremy Kerr2011-04-143-5/+29
| | | | | | | | | | Since we have infrastructure for email confirmations, we no longer need the separate registration app. Requires a migration script, which will delete all inactive users, including those newly added and pending confirmation. Use carefully. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use generic email confirmation objectJeremy Kerr2011-04-143-3/+14
| | | | | | | | | | | | | Rather than having a UserPerson-specific confirmation, add an EmailConfirmation object to allow multiple types of confirmations (eg, opt-out requests in future). To do this, we use a view (patchwork.views.confirm) that will call the type-specific view with the confirmation object. Also, add tests to check that the User/Person linkage system works. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add support for git-pull requestsJeremy Kerr2010-11-011-0/+6
| | | | | | | | | Add a a pull_url to the Patch object, and update the parser to look for git-pull style emails. Requires SQL migration script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* sql: Add uncommitted migration scriptsJeremy Kerr2010-08-102-0/+29
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Adjust postgres "grant all" script to new name of bundle tableJunio C Hamano2009-11-231-2/+2
| | | | | | | | | | | | | | Since c105cb0 (Initial bundle reordering support, 2009-01-29), the patchwork_bundle_patches table and its associated id sequence does not exist. The script to grant appropriate privileges was not updated when this change was made, and causes the set-up procedure described in docs/INSTALL to fail. This change adjust the script to grant appropriate access rights to match the change in the DB schema. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* migration: fix whitespaceJeremy Kerr2009-02-271-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* migration: reset bundlepatch sequence on setupJeremy Kerr2009-02-271-0/+4
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* [sql] Fix up bundle-reorder migration scriptJeremy Kerr2009-02-101-1/+5
| | | | | | | We need to add grants for the new table, and drop the old to prevent reference constraint errors. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* [sql] Perserve bundle ordering in bundle reorder migration scriptJeremy Kerr2009-02-081-7/+25
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Normalise order numbers in bundle-ordering migration SQLJeremy Kerr2009-02-071-0/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Complete bundle ordering migration scriptJeremy Kerr2009-02-071-5/+7
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Initial bundle reordering supportJeremy Kerr2009-01-291-0/+9
| | | | | | | | | todo: * implement ajax reorder api * finish migration script * order patches in bundle view Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* [models] Make patches unique on (msgid, project), not just (msgid)Jeremy Kerr2008-10-291-0/+7
| | | | | | | | | | On patchwork.ozlabs.org, we may see multiple patches for different projects, but with the same message-id. We want these patches to show up on both projects, so we need to change the current UNIQUE contstraint on msgid. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* [sql] use separate grant-all scripts for postgresql and mysqlJeremy Kerr2008-10-092-0/+35
| | | | | | | | | | Mysql doesn't support granting to multiple tables, and requires a different username format. Would be nice to code the permissions somewhere, then generate the grant statements as required. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Don't just rely on random for UserPersonConfirmation keysJeremy Kerr2008-09-111-0/+4
| | | | | | | | | | | It looks like we're getting identical keys generated for confirmation keys. Problem has been reported to django, but in the meantime, salt with the user and email details, then sha1 to give the final key. This requires an increase in the field size for key, migration script included. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use hex strings for hash valuesJeremy Kerr2008-09-101-0/+8
| | | | | | | | | | Binary strings a too hard to manage in DB queries and XMLRPC methods, as we get all kinds of encoding issues. Change HashField to use a hex string, and add a migration script for db updates. The patches should be rehashed after migration. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add DB permissions for registration appJeremy Kerr2008-08-221-4/+4
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Get parsemail scripts goingJeremy Kerr2008-08-211-1/+2
| | | | | | A couple of fixes, plus required permissions in the grant-all script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Inital commitJeremy Kerr2008-08-211-0/+68
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>