##// END OF EJS Templates
Merge with upstream
Nicolas VINOT -
r1588:8ac66733 merge beta
parent child Browse files
Show More
@@ -160,6 +160,8 class DbManage(object):
160 160 def step_3(self):
161 161 print ('Adding additional settings into RhodeCode db')
162 162 self.klass.fix_settings()
163 print ('Adding ldap defaults')
164 self.klass.create_ldap_options(skip_existing=True)
163 165
164 166 upgrade_steps = [0] + range(curr_version + 1, __dbversion__ + 1)
165 167
@@ -307,7 +309,7 class DbManage(object):
307 309 self.sa.rollback()
308 310 raise
309 311
310 def create_ldap_options(self):
312 def create_ldap_options(self,skip_existing=False):
311 313 """Creates ldap settings"""
312 314
313 315 try:
@@ -319,6 +321,9 class DbManage(object):
319 321 ('ldap_attr_login', ''), ('ldap_attr_firstname', ''),
320 322 ('ldap_attr_lastname', ''), ('ldap_attr_email', '')]:
321 323
324 if skip_existing and RhodeCodeSettings.get_by_name(k) != None:
325 log.debug('Skipping option %s' % k)
326 continue
322 327 setting = RhodeCodeSettings(k, v)
323 328 self.sa.add(setting)
324 329 self.sa.commit()
@@ -76,6 +76,14 def upgrade(migrate_engine):
76 76 #==========================================================================
77 77 from rhodecode.model.db import Repository
78 78
79 #ADD clone_uri column#
80
81 clone_uri = Column("clone_uri", String(length=255, convert_unicode=False,
82 assert_unicode=None),
83 nullable=True, unique=False, default=None)
84
85 clone_uri.create(Repository().__table__)
86
79 87 #ADD downloads column#
80 88 enable_downloads = Column("downloads", Boolean(), nullable=True, unique=None, default=True)
81 89 enable_downloads.create(Repository().__table__)
@@ -92,21 +100,16 def upgrade(migrate_engine):
92 100 group_id.create(Repository().__table__)
93 101
94 102
95 #ADD clone_uri column#
96
97 clone_uri = Column("clone_uri", String(length=255, convert_unicode=False,
98 assert_unicode=None),
99 nullable=True, unique=False, default=None)
100
101 clone_uri.create(Repository().__table__)
102
103
104 103 #==========================================================================
105 104 # Upgrade of `user_followings` table
106 105 #==========================================================================
107 106
108 follows_from = Column('follows_from', DateTime(timezone=False), nullable=True, unique=None, default=datetime.datetime.now)
109 follows_from.create(Repository().__table__)
107 from rhodecode.model.db import UserFollowing
108
109 follows_from = Column('follows_from', DateTime(timezone=False),
110 nullable=True, unique=None,
111 default=datetime.datetime.now)
112 follows_from.create(UserFollowing().__table__)
110 113
111 114 return
112 115
@@ -12,6 +12,7 if py_version < (2, 5):
12 12 requirements = [
13 13 "Pylons==1.0.0",
14 14 "WebHelpers>=1.2",
15 "formencode==1.2.4",
15 16 "SQLAlchemy>=0.7.2,<0.8",
16 17 "Mako>=0.4.2",
17 18 "pygments>=1.4",
General Comments 0
You need to be logged in to leave comments. Login now