Show More
@@ -160,7 +160,9 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 | ||
|
163 | print ('Adding ldap defaults') | |
|
164 | self.klass.create_ldap_options(skip_existing=True) | |
|
165 | ||
|
164 | 166 | upgrade_steps = [0] + range(curr_version + 1, __dbversion__ + 1) |
|
165 | 167 | |
|
166 | 168 | #CALL THE PROPER ORDER OF STEPS TO PERFORM FULL UPGRADE |
@@ -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 |
General Comments 0
You need to be logged in to leave comments.
Login now