]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
mg-schema-test-database: Bump flight sequence number in test DB
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 7 Dec 2015 17:22:54 +0000 (17:22 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 8 Dec 2015 14:51:02 +0000 (14:51 +0000)
This makes test flights have different numbers to those currently in
production, which will help avoid accidents.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: New patch

mg-schema-test-database

index 78f26db6e50be597bf402b9bc58b9c3330e0964b..b41a99bba2663c14fdadb25f58826e30906b5a78 100755 (executable)
@@ -430,6 +430,19 @@ END
 
        rm -f $t.tabledata.*
 
+       printf "flightseq..."
+
+       lastflight=$(psql_query <<END
+               SELECT last_value FROM flights_flight_seq
+END
+               )
+       newlastflight=$(( 10000 * (2 + $lastflight / 10000) ))
+
+       withtest psql_do <<END
+               ALTER SEQUENCE flights_flight_seq
+                       RESTART WITH $newlastflight;
+END
+
        #---------- actually borrow resources ----------
 
        printf "borrow..."