Show More
@@ -156,8 +156,11 b' class DbManage(object):' | |||
|
156 | 156 | 'rhodecode/lib/dbmigrate') |
|
157 | 157 | db_uri = self.dburi |
|
158 | 158 | |
|
159 | if version: | |
|
160 | DbMigrateVersion.set_version(version) | |
|
161 | ||
|
159 | 162 | try: |
|
160 |
curr_version = |
|
|
163 | curr_version = api.db_version(db_uri, repository_path) | |
|
161 | 164 | msg = ('Found current database db_uri under version ' |
|
162 | 165 | 'control with version {}'.format(curr_version)) |
|
163 | 166 |
@@ -25,6 +25,7 b' import pyramid.paster' | |||
|
25 | 25 | |
|
26 | 26 | from rhodecode.lib.pyramid_utils import bootstrap |
|
27 | 27 | from rhodecode.lib.db_manage import DbManage |
|
28 | from rhodecode.lib.utils2 import safe_int | |
|
28 | 29 | |
|
29 | 30 | log = logging.getLogger(__name__) |
|
30 | 31 | |
@@ -33,11 +34,13 b' log = logging.getLogger(__name__)' | |||
|
33 | 34 | @click.argument('ini_path', type=click.Path(exists=True)) |
|
34 | 35 | @click.option('--force-yes/--force-no', default=None, |
|
35 | 36 | help="Force yes/no to every question") |
|
36 | def main(ini_path, force_yes): | |
|
37 | return command(ini_path, force_yes) | |
|
37 | @click.option('--force-version', default=None, | |
|
38 | help="Force upgrade from version") | |
|
39 | def main(ini_path, force_yes, force_version): | |
|
40 | return command(ini_path, force_yes, force_version) | |
|
38 | 41 | |
|
39 | 42 | |
|
40 | def command(ini_path, force_yes): | |
|
43 | def command(ini_path, force_yes, force_version): | |
|
41 | 44 | pyramid.paster.setup_logging(ini_path) |
|
42 | 45 | |
|
43 | 46 | with bootstrap(ini_path, env={'RC_CMD_UPGRADE_DB': '1'}) as env: |
@@ -49,4 +52,4 b' def command(ini_path, force_yes):' | |||
|
49 | 52 | dbmanage = DbManage( |
|
50 | 53 | log_sql=True, dbconf=db_uri, root='.', tests=False, |
|
51 | 54 | cli_args=options) |
|
52 | dbmanage.upgrade() | |
|
55 | dbmanage.upgrade(version=safe_int(force_version)) |
General Comments 0
You need to be logged in to leave comments.
Login now