X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=lib%2Fsql%2Fmigration%2F005-bundle-patch-ordering.sql;fp=lib%2Fsql%2Fmigration%2F005-bundle-patch-ordering.sql;h=3f0ad1340dd2cbdc5e7a72f84e07b6763cc9a90b;hb=192e5a259a47336af5fce2d72107f605caee7b9a;hp=f6e37eb01853513d0c23aa4c3162e686885ed0cd;hpb=e4d886928c31037555fb457a4f7a08c8836b131f;p=patchwork 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