##// END OF EJS Templates
db migrations:...
marcink -
r838:12eb1a01 beta
parent child Browse files
Show More
@@ -3,7 +3,8 b''
3 3 rhodecode.lib.db_manage
4 4 ~~~~~~~~~~~~~~~~~~~~~~~
5 5
6 Database creation, and setup module for RhodeCode
6 Database creation, and setup module for RhodeCode. Used for creation
7 of database as well as for migration operations
7 8
8 9 :created_on: Apr 10, 2010
9 10 :author: marcink
@@ -117,6 +118,25 b' class DbManage(object):'
117 118 self.sa.rollback()
118 119 raise
119 120
121 def fix_default_user(self):
122 """Fixes a old default user with some 'nicer' default values,
123 used mostly for anonymous access
124 """
125 def_user = self.sa.query(User)\
126 .filter(User.username == 'default')\
127 .one()
128
129 def_user.name = 'Anonymous'
130 def_user.lastname = 'User'
131 def_user.email = 'anonymous@rhodecode.org'
132
133 try:
134 self.sa.add(def_user)
135 self.sa.commit()
136 except:
137 self.sa.rollback()
138 raise
139
120 140
121 141
122 142 def admin_prompt(self, second=False):
@@ -81,14 +81,17 b' class UpgradeDb(BasePasterCommand):'
81 81 self.notify_msg('Schema upgrade completed')
82 82
83 83 #we need to make now some extra operations into database
84 self.notify_msg('Prociding with database updates')
84 self.notify_msg('Propagating database updates')
85 85
86 86 dbmanage = DbManage(log_sql=True, dbconf=db_uri,
87 87 root=config['here'], tests=False)
88 88
89 self.notify_msg('Patching repo paths for newer version of rhodecode')
89 self.notify_msg('Patching repo paths for newer version of RhodeCode')
90 90 dbmanage.fix_repo_paths()
91 91
92 self.notify_msg('Patching default user of RhodeCode')
93 dbmanage.fix_default_user()
94
92 95 self.notify_msg('Changing ui settings')
93 96 dbmanage.create_ui_settings()
94 97
General Comments 0
You need to be logged in to leave comments. Login now