summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-02-10 14:30:38 +1100
committerJeremy Kerr <jk@ozlabs.org>2009-02-10 14:30:38 +1100
commit17e39712c3f9398f4aa6aae9f368f642af615eab (patch)
treedd0d8e4e3942a0abeb511cff60df112611050693 /lib
parent6c119273e873bc2c63ac470e7b975a721b9a6826 (diff)
downloadpatchwork-17e39712c3f9398f4aa6aae9f368f642af615eab.tar.bz2
patchwork-17e39712c3f9398f4aa6aae9f368f642af615eab.tar.xz
[sql] Fix up bundle-reorder migration script
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/sql/migration/005-bundle-patch-ordering.sql6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sql/migration/005-bundle-patch-ordering.sql b/lib/sql/migration/005-bundle-patch-ordering.sql
index 238e37b..f6e37eb 100644
--- a/lib/sql/migration/005-bundle-patch-ordering.sql
+++ b/lib/sql/migration/005-bundle-patch-ordering.sql
@@ -23,10 +23,14 @@ BEGIN;
ALTER TABLE patchwork_bundlepatch
ALTER COLUMN "order" TYPE INTEGER;
+DROP TABLE patchwork_bundle_patches;
+
-- normalise ordering: order should start with 1 in each bundle
UPDATE patchwork_bundlepatch SET "order" = 1 + "order" -
(SELECT min("order") FROM patchwork_bundlepatch AS p2
WHERE p2.bundle_id = patchwork_bundlepatch.bundle_id);
-SELECT * FROM patchwork_bundlepatch;
+GRANT SELECT, INSERT, UPDATE, DELETE ON patchwork_bundlepatch TO "www-data";
+GRANT SELECT, UPDATE ON patchwork_bundlepatch_id_seq TO "www-data";
+
COMMIT;