From: Jeremy Kerr Date: Fri, 27 Feb 2009 02:40:49 +0000 (+1100) Subject: migration: reset bundlepatch sequence on setup X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=192e5a259a47336af5fce2d72107f605caee7b9a;p=patchwork migration: reset bundlepatch sequence on setup Signed-off-by: Jeremy Kerr --- 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