##// END OF EJS Templates
upgrade: fixed old style rc upgrade sometimes used with a very old installer.
marcink -
r3505:c75dd264 stable
parent child Browse files
Show More
@@ -1,63 +1,64 b''
1 1 # -*- coding: utf-8 -*-
2 2
3 3 # Copyright (C) 2010-2019 RhodeCode GmbH
4 4 #
5 5 # This program is free software: you can redistribute it and/or modify
6 6 # it under the terms of the GNU Affero General Public License, version 3
7 7 # (only), as published by the Free Software Foundation.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU Affero General Public License
15 15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 16 #
17 17 # This program is dual-licensed. If you wish to learn more about the
18 18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21 21 import logging
22 22
23 23 from rhodecode.lib.paster_commands import BasePasterCommand, Command
24 24
25 25 log = logging.getLogger(__name__)
26 26
27 27
28 28 class UpgradeDb(BasePasterCommand):
29 """Command used for paster to upgrade our database to newer version
29 """
30 Command used for paster to upgrade our database to newer version
30 31 """
31 32
32 33 max_args = 1
33 34 min_args = 1
34 35
35 36 usage = "CONFIG_FILE"
36 37 summary = "Upgrades current db to newer version"
37 38 group_name = "RhodeCode"
38 39
39 40 parser = Command.standard_parser(verbose=True)
40 41
41 42 def command(self):
42 43 from rhodecode.lib.rc_commands import upgrade_db
43 44 upgrade_db.command(
44 self.path_to_ini_file, self.options.__dict__.get('force_ask'))
45 self.path_to_ini_file, self.options.__dict__.get('force_ask'), None)
45 46
46 47 def update_parser(self):
47 48 self.parser.add_option('--sql',
48 49 action='store_true',
49 50 dest='just_sql',
50 51 help="Prints upgrade sql for further investigation",
51 52 default=False)
52 53
53 54 self.parser.add_option('--force-yes',
54 55 action='store_true',
55 56 dest='force_ask',
56 57 default=None,
57 58 help='Force yes to every question')
58 59 self.parser.add_option('--force-no',
59 60 action='store_false',
60 61 dest='force_ask',
61 62 default=None,
62 63 help='Force no to every question')
63 64
General Comments 0
You need to be logged in to leave comments. Login now