]> git.ozlabs.org Git - patchwork/commitdiff
lib/sql/migration: Fix column names for MySQL/MariaDB
authorRalf Baechle <ralf@linux-mips.org>
Mon, 29 Jul 2013 14:46:33 +0000 (16:46 +0200)
committerJeremy Kerr <jk@ozlabs.org>
Sun, 13 Oct 2013 06:55:59 +0000 (14:55 +0800)
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

index d984ad2df139c549e817d9c410b1dff67598b66b..ecade2801920b946e284d402663d9af2926e7978 100644 (file)
@@ -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;