diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2009-02-10 14:30:38 +1100 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2009-02-10 14:30:38 +1100 |
commit | 17e39712c3f9398f4aa6aae9f368f642af615eab (patch) | |
tree | dd0d8e4e3942a0abeb511cff60df112611050693 /lib/sql | |
parent | 6c119273e873bc2c63ac470e7b975a721b9a6826 (diff) | |
download | patchwork-17e39712c3f9398f4aa6aae9f368f642af615eab.tar patchwork-17e39712c3f9398f4aa6aae9f368f642af615eab.tar.gz |
[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/sql')
-rw-r--r-- | lib/sql/migration/005-bundle-patch-ordering.sql | 6 |
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; |