3
# Copyright 2009 Canonical Ltd. This software is licensed under the
4
# GNU Affero General Public License version 3 (see the file LICENSE).
7
The sampledata does not update the current values of all the sequences
8
used to populate the primary keys (this was removed to aid in merging changes
11
This script resets all of these sequences to the correct value based on the
12
maximum value currently found in the corresponding table.
17
# pylint: disable-msg=W0403
20
from optparse import OptionParser
21
from canonical.database.postgresql import resetSequences
22
from canonical.database.sqlbase import connect
23
from lp.services.scripts import db_options
25
if __name__ == '__main__':
26
parser = OptionParser()
28
(options, args) = parser.parse_args()
30
parser.error("Too many options given")
31
if not options.dbname:
32
parser.error("Required option --dbname not given")
34
resetSequences(con.cursor())