summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-02-27 13:40:49 +1100
committerJeremy Kerr <jk@ozlabs.org>2009-02-27 13:40:49 +1100
commit192e5a259a47336af5fce2d72107f605caee7b9a (patch)
treee53e3fb05df216ccfa70e6c2ae8a8a7a8266125c /lib
parente4d886928c31037555fb457a4f7a08c8836b131f (diff)
downloadpatchwork-192e5a259a47336af5fce2d72107f605caee7b9a.tar.bz2
patchwork-192e5a259a47336af5fce2d72107f605caee7b9a.tar.xz
migration: reset bundlepatch sequence on setup
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/sql/migration/005-bundle-patch-ordering.sql4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sql/migration/005-bundle-patch-ordering.sql b/lib/sql/migration/005-bundle-patch-ordering.sql
index f6e37eb..3f0ad13 100644
--- a/lib/sql/migration/005-bundle-patch-ordering.sql
+++ b/lib/sql/migration/005-bundle-patch-ordering.sql
@@ -23,6 +23,10 @@ BEGIN;
ALTER TABLE patchwork_bundlepatch
ALTER COLUMN "order" TYPE INTEGER;
+-- initialise the starting number for this sequence
+SELECT setval('patchwork_bundlepatch_id_seq',
+ (SELECT max(id) + 1 FROM patchwork_bundlepatch));
+
DROP TABLE patchwork_bundle_patches;
-- normalise ordering: order should start with 1 in each bundle