From 8fd9086f337a09125ddcfaa616e762a4d85c6000 Mon Sep 17 00:00:00 2001
From: Jeremy Kerr <jk@ozlabs.org>
Date: Sat, 20 Apr 2013 22:34:28 +0800
Subject: bundles: Don't allow slashes in bundle names

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>
---
 lib/sql/migration/013-bundle-names.sql | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 lib/sql/migration/013-bundle-names.sql

(limited to 'lib/sql/migration/013-bundle-names.sql')

diff --git a/lib/sql/migration/013-bundle-names.sql b/lib/sql/migration/013-bundle-names.sql
new file mode 100644
index 0000000..3dbbfb1
--- /dev/null
+++ b/lib/sql/migration/013-bundle-names.sql
@@ -0,0 +1,6 @@
+BEGIN;
+UPDATE patchwork_bundle
+	SET name = replace(name, '/', '-')
+	WHERE name like '%/%';
+COMMIT;
+
-- 
cgit v1.2.3

