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