From 4d7fcc9062659aa74377b39dd87de35c07973ec2 Mon Sep 17 00:00:00 2001
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 29 Jul 2013 16:46:33 +0200
Subject: lib/sql/migration: Fix column names for MySQL/MariaDB

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>
---
 lib/sql/migration/012-project-add-columns.sql | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'lib/sql/migration/012-project-add-columns.sql')

diff --git a/lib/sql/migration/012-project-add-columns.sql b/lib/sql/migration/012-project-add-columns.sql
index d984ad2..ecade28 100644
--- a/lib/sql/migration/012-project-add-columns.sql
+++ b/lib/sql/migration/012-project-add-columns.sql
@@ -1,5 +1,5 @@
 BEGIN;
-ALTER TABLE "patchwork_project" ADD COLUMN "web_url" varchar(2000);
-ALTER TABLE "patchwork_project" ADD COLUMN "scm_url" varchar(2000);
-ALTER TABLE "patchwork_project" ADD COLUMN "webscm_url" varchar(2000);
+ALTER TABLE patchwork_project ADD COLUMN web_url varchar(2000);
+ALTER TABLE patchwork_project ADD COLUMN scm_url varchar(2000);
+ALTER TABLE patchwork_project ADD COLUMN webscm_url varchar(2000);
 COMMIT;
-- 
cgit v1.2.3

