##// END OF EJS Templates
SETTINGS_PREFIX for identifiers (e.g., db table names) incl. project's name....
Bradley M. Kuhn -
r4219:24498ba2 kallithea-2.2.5-r...
parent child Browse files
Show More
@@ -22,7 +22,7 b' This file was forked by the Kallithea pr'
22 Original author and date, and relevant copyright and licensing information is below:
22 Original author and date, and relevant copyright and licensing information is below:
23 :created_on: Apr 9, 2010
23 :created_on: Apr 9, 2010
24 :author: marcink
24 :author: marcink
25 :copyright: (c) 2013 RhodeCode GmbH, and others.
25 :copyright: (c) 2013 RhodeCode GmbH, (C) 2014 Bradley M. Kuhn, and others.
26 :license: GPLv3, see LICENSE.md for more details.
26 :license: GPLv3, see LICENSE.md for more details.
27 """
27 """
28
28
@@ -44,6 +44,20 b' CONFIG = {}'
44 # Linked module for extensions
44 # Linked module for extensions
45 EXTENSIONS = {}
45 EXTENSIONS = {}
46
46
47 # SETTINGS_PREFIX is the prefix to use for form fields and database table names.
48
49 # Ideally, SETTINGS_PREFIX would be in an ini file of some sort instead of
50 # in this code. However, since this is used in kallithea/model/db.py as
51 # part of the database initialization in code that typically runs before
52 # CONFIG (above) is populated with settings from the ini file, it's instead
53 # hard-coded herein.
54
55 SETTINGS_PREFIX = "kallithea_"
56 # NOTE: If you want compatibility with a database that was originally created
57 # for use with the Rhodecode software product, changing SETTINGS_PREFIX to
58 # "rhodecode_" might work to make the old database and forms compatible with
59 # this application.
60
47 try:
61 try:
48 from kallithea.lib import get_current_revision
62 from kallithea.lib import get_current_revision
49 _rev = get_current_revision(quiet=True)
63 _rev = get_current_revision(quiet=True)
@@ -49,6 +49,7 b' from kallithea.lib.compat import json'
49 from kallithea.model.meta import Base, Session
49 from kallithea.model.meta import Base, Session
50 from kallithea.lib.caching_query import FromCache
50 from kallithea.lib.caching_query import FromCache
51
51
52 from kallithea import SETTINGS_PREFIX
52
53
53 log = logging.getLogger(__name__)
54 log = logging.getLogger(__name__)
54
55
@@ -142,7 +143,7 b' class BaseModel(object):'
142
143
143
144
144 class Setting(Base, BaseModel):
145 class Setting(Base, BaseModel):
145 __tablename__ = 'rhodecode_settings'
146 __tablename__ = SETTINGS_PREFIX + 'settings'
146 __table_args__ = (UniqueConstraint('app_settings_name'), {'extend_existing':True})
147 __table_args__ = (UniqueConstraint('app_settings_name'), {'extend_existing':True})
147 app_settings_id = Column("app_settings_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
148 app_settings_id = Column("app_settings_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
148 app_settings_name = Column("app_settings_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
149 app_settings_name = Column("app_settings_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
@@ -213,7 +214,7 b' class Setting(Base, BaseModel):'
213
214
214
215
215 class Ui(Base, BaseModel):
216 class Ui(Base, BaseModel):
216 __tablename__ = 'rhodecode_ui'
217 __tablename__ = SETTINGS_PREFIX + 'ui'
217 __table_args__ = (UniqueConstraint('ui_key'), {'extend_existing':True})
218 __table_args__ = (UniqueConstraint('ui_key'), {'extend_existing':True})
218
219
219 HOOK_UPDATE = 'changegroup.update'
220 HOOK_UPDATE = 'changegroup.update'
@@ -51,6 +51,7 b' from kallithea.lib.caching_query import '
51 from kallithea.model.meta import Base, Session
51 from kallithea.model.meta import Base, Session
52 import hashlib
52 import hashlib
53
53
54 from kallithea import SETTINGS_PREFIX
54
55
55 log = logging.getLogger(__name__)
56 log = logging.getLogger(__name__)
56
57
@@ -157,7 +158,7 b' class BaseModel(object):'
157 return '<DB:%s>' % (self.__class__.__name__)
158 return '<DB:%s>' % (self.__class__.__name__)
158
159
159 class Setting(Base, BaseModel):
160 class Setting(Base, BaseModel):
160 __tablename__ = 'rhodecode_settings'
161 __tablename__ = SETTINGS_PREFIX + 'settings'
161 __table_args__ = (
162 __table_args__ = (
162 UniqueConstraint('app_settings_name'),
163 UniqueConstraint('app_settings_name'),
163 {'extend_existing': True, 'mysql_engine':'InnoDB',
164 {'extend_existing': True, 'mysql_engine':'InnoDB',
@@ -232,7 +233,7 b' class Setting(Base, BaseModel):'
232
233
233
234
234 class Ui(Base, BaseModel):
235 class Ui(Base, BaseModel):
235 __tablename__ = 'rhodecode_ui'
236 __tablename__ = SETTINGS_PREFIX + 'ui'
236 __table_args__ = (
237 __table_args__ = (
237 UniqueConstraint('ui_key'),
238 UniqueConstraint('ui_key'),
238 {'extend_existing': True, 'mysql_engine':'InnoDB',
239 {'extend_existing': True, 'mysql_engine':'InnoDB',
@@ -55,6 +55,8 b' from kallithea.lib.caching_query import '
55
55
56 from kallithea.model.meta import Base, Session
56 from kallithea.model.meta import Base, Session
57
57
58 from kallithea import SETTINGS_PREFIX
59
58 URL_SEP = '/'
60 URL_SEP = '/'
59 log = logging.getLogger(__name__)
61 log = logging.getLogger(__name__)
60
62
@@ -148,7 +150,7 b' class BaseModel(object):'
148
150
149
151
150 class Setting(Base, BaseModel):
152 class Setting(Base, BaseModel):
151 __tablename__ = 'rhodecode_settings'
153 __tablename__ = SETTINGS_PREFIX + 'settings'
152 __table_args__ = (
154 __table_args__ = (
153 UniqueConstraint('app_settings_name'),
155 UniqueConstraint('app_settings_name'),
154 {'extend_existing': True, 'mysql_engine': 'InnoDB',
156 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -230,7 +232,7 b' class Setting(Base, BaseModel):'
230
232
231
233
232 class Ui(Base, BaseModel):
234 class Ui(Base, BaseModel):
233 __tablename__ = 'rhodecode_ui'
235 __tablename__ = SETTINGS_PREFIX + 'ui'
234 __table_args__ = (
236 __table_args__ = (
235 UniqueConstraint('ui_key'),
237 UniqueConstraint('ui_key'),
236 {'extend_existing': True, 'mysql_engine': 'InnoDB',
238 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -54,6 +54,8 b' from kallithea.lib.caching_query import '
54
54
55 from kallithea.model.meta import Base, Session
55 from kallithea.model.meta import Base, Session
56
56
57 from kallithea import SETTINGS_PREFIX
58
57 URL_SEP = '/'
59 URL_SEP = '/'
58 log = logging.getLogger(__name__)
60 log = logging.getLogger(__name__)
59
61
@@ -147,7 +149,7 b' class BaseModel(object):'
147
149
148
150
149 class Setting(Base, BaseModel):
151 class Setting(Base, BaseModel):
150 __tablename__ = 'rhodecode_settings'
152 __tablename__ = SETTINGS_PREFIX + 'settings'
151 __table_args__ = (
153 __table_args__ = (
152 UniqueConstraint('app_settings_name'),
154 UniqueConstraint('app_settings_name'),
153 {'extend_existing': True, 'mysql_engine': 'InnoDB',
155 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -246,7 +248,7 b' class Setting(Base, BaseModel):'
246
248
247
249
248 class Ui(Base, BaseModel):
250 class Ui(Base, BaseModel):
249 __tablename__ = 'rhodecode_ui'
251 __tablename__ = SETTINGS_PREFIX + 'ui'
250 __table_args__ = (
252 __table_args__ = (
251 UniqueConstraint('ui_key'),
253 UniqueConstraint('ui_key'),
252 {'extend_existing': True, 'mysql_engine': 'InnoDB',
254 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -58,6 +58,8 b' from kallithea.model.meta import Base, S'
58 URL_SEP = '/'
58 URL_SEP = '/'
59 log = logging.getLogger(__name__)
59 log = logging.getLogger(__name__)
60
60
61 from kallithea import SETTINGS_PREFIX
62
61 #==============================================================================
63 #==============================================================================
62 # BASE CLASSES
64 # BASE CLASSES
63 #==============================================================================
65 #==============================================================================
@@ -148,7 +150,7 b' class BaseModel(object):'
148
150
149
151
150 class Setting(Base, BaseModel):
152 class Setting(Base, BaseModel):
151 __tablename__ = 'rhodecode_settings'
153 __tablename__ = SETTINGS_PREFIX + 'settings'
152 __table_args__ = (
154 __table_args__ = (
153 UniqueConstraint('app_settings_name'),
155 UniqueConstraint('app_settings_name'),
154 {'extend_existing': True, 'mysql_engine': 'InnoDB',
156 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -247,7 +249,7 b' class Setting(Base, BaseModel):'
247
249
248
250
249 class Ui(Base, BaseModel):
251 class Ui(Base, BaseModel):
250 __tablename__ = 'rhodecode_ui'
252 __tablename__ = SETTINGS_PREFIX + 'ui'
251 __table_args__ = (
253 __table_args__ = (
252 UniqueConstraint('ui_key'),
254 UniqueConstraint('ui_key'),
253 {'extend_existing': True, 'mysql_engine': 'InnoDB',
255 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -58,6 +58,8 b' from kallithea.model.meta import Base, S'
58 URL_SEP = '/'
58 URL_SEP = '/'
59 log = logging.getLogger(__name__)
59 log = logging.getLogger(__name__)
60
60
61 from kallithea import SETTINGS_PREFIX
62
61 #==============================================================================
63 #==============================================================================
62 # BASE CLASSES
64 # BASE CLASSES
63 #==============================================================================
65 #==============================================================================
@@ -148,7 +150,7 b' class BaseModel(object):'
148
150
149
151
150 class Setting(Base, BaseModel):
152 class Setting(Base, BaseModel):
151 __tablename__ = 'rhodecode_settings'
153 __tablename__ = SETTINGS_PREFIX + 'settings'
152 __table_args__ = (
154 __table_args__ = (
153 UniqueConstraint('app_settings_name'),
155 UniqueConstraint('app_settings_name'),
154 {'extend_existing': True, 'mysql_engine': 'InnoDB',
156 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -247,7 +249,7 b' class Setting(Base, BaseModel):'
247
249
248
250
249 class Ui(Base, BaseModel):
251 class Ui(Base, BaseModel):
250 __tablename__ = 'rhodecode_ui'
252 __tablename__ = SETTINGS_PREFIX + 'ui'
251 __table_args__ = (
253 __table_args__ = (
252 UniqueConstraint('ui_key'),
254 UniqueConstraint('ui_key'),
253 {'extend_existing': True, 'mysql_engine': 'InnoDB',
255 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -58,6 +58,8 b' from kallithea.model.meta import Base, S'
58 URL_SEP = '/'
58 URL_SEP = '/'
59 log = logging.getLogger(__name__)
59 log = logging.getLogger(__name__)
60
60
61 from kallithea import SETTINGS_PREFIX
62
61 #==============================================================================
63 #==============================================================================
62 # BASE CLASSES
64 # BASE CLASSES
63 #==============================================================================
65 #==============================================================================
@@ -153,7 +155,7 b' class BaseModel(object):'
153
155
154
156
155 class Setting(Base, BaseModel):
157 class Setting(Base, BaseModel):
156 __tablename__ = 'rhodecode_settings'
158 __tablename__ = SETTINGS_PREFIX + 'settings'
157 __table_args__ = (
159 __table_args__ = (
158 UniqueConstraint('app_settings_name'),
160 UniqueConstraint('app_settings_name'),
159 {'extend_existing': True, 'mysql_engine': 'InnoDB',
161 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -252,7 +254,7 b' class Setting(Base, BaseModel):'
252
254
253
255
254 class Ui(Base, BaseModel):
256 class Ui(Base, BaseModel):
255 __tablename__ = 'rhodecode_ui'
257 __tablename__ = SETTINGS_PREFIX + 'ui'
256 __table_args__ = (
258 __table_args__ = (
257 UniqueConstraint('ui_key'),
259 UniqueConstraint('ui_key'),
258 {'extend_existing': True, 'mysql_engine': 'InnoDB',
260 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -58,6 +58,8 b' from kallithea.model.meta import Base, S'
58 URL_SEP = '/'
58 URL_SEP = '/'
59 log = logging.getLogger(__name__)
59 log = logging.getLogger(__name__)
60
60
61 from kallithea import SETTINGS_PREFIX
62
61 #==============================================================================
63 #==============================================================================
62 # BASE CLASSES
64 # BASE CLASSES
63 #==============================================================================
65 #==============================================================================
@@ -153,7 +155,7 b' class BaseModel(object):'
153
155
154
156
155 class Setting(Base, BaseModel):
157 class Setting(Base, BaseModel):
156 __tablename__ = 'rhodecode_settings'
158 __tablename__ = SETTINGS_PREFIX + 'settings'
157 __table_args__ = (
159 __table_args__ = (
158 UniqueConstraint('app_settings_name'),
160 UniqueConstraint('app_settings_name'),
159 {'extend_existing': True, 'mysql_engine': 'InnoDB',
161 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -270,7 +272,7 b' class Setting(Base, BaseModel):'
270
272
271
273
272 class Ui(Base, BaseModel):
274 class Ui(Base, BaseModel):
273 __tablename__ = 'rhodecode_ui'
275 __tablename__ = SETTINGS_PREFIX + 'ui'
274 __table_args__ = (
276 __table_args__ = (
275 UniqueConstraint('ui_key'),
277 UniqueConstraint('ui_key'),
276 {'extend_existing': True, 'mysql_engine': 'InnoDB',
278 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -59,6 +59,8 b' from kallithea.model.meta import Base, S'
59 URL_SEP = '/'
59 URL_SEP = '/'
60 log = logging.getLogger(__name__)
60 log = logging.getLogger(__name__)
61
61
62 from kallithea import SETTINGS_PREFIX
63
62 #==============================================================================
64 #==============================================================================
63 # BASE CLASSES
65 # BASE CLASSES
64 #==============================================================================
66 #==============================================================================
@@ -161,7 +163,7 b' class Setting(Base, BaseModel):'
161 'bool': str2bool,
163 'bool': str2bool,
162 'list': functools.partial(aslist, sep=',')
164 'list': functools.partial(aslist, sep=',')
163 }
165 }
164 __tablename__ = 'rhodecode_settings'
166 __tablename__ = SETTINGS_PREFIX + 'settings'
165 __table_args__ = (
167 __table_args__ = (
166 UniqueConstraint('app_settings_name'),
168 UniqueConstraint('app_settings_name'),
167 {'extend_existing': True, 'mysql_engine': 'InnoDB',
169 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -317,7 +319,7 b' class Setting(Base, BaseModel):'
317
319
318
320
319 class Ui(Base, BaseModel):
321 class Ui(Base, BaseModel):
320 __tablename__ = 'rhodecode_ui'
322 __tablename__ = SETTINGS_PREFIX + 'ui'
321 __table_args__ = (
323 __table_args__ = (
322 UniqueConstraint('ui_key'),
324 UniqueConstraint('ui_key'),
323 {'extend_existing': True, 'mysql_engine': 'InnoDB',
325 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -56,6 +56,8 b' from kallithea.lib.caching_query import '
56
56
57 from kallithea.model.meta import Base, Session
57 from kallithea.model.meta import Base, Session
58
58
59 from kallithea import SETTINGS_PREFIX
60
59 URL_SEP = '/'
61 URL_SEP = '/'
60 log = logging.getLogger(__name__)
62 log = logging.getLogger(__name__)
61
63
@@ -164,7 +166,7 b' class Setting(Base, BaseModel):'
164 'bool': str2bool,
166 'bool': str2bool,
165 'list': functools.partial(aslist, sep=',')
167 'list': functools.partial(aslist, sep=',')
166 }
168 }
167 __tablename__ = 'rhodecode_settings'
169 __tablename__ = SETTINGS_PREFIX + 'settings'
168 __table_args__ = (
170 __table_args__ = (
169 UniqueConstraint('app_settings_name'),
171 UniqueConstraint('app_settings_name'),
170 {'extend_existing': True, 'mysql_engine': 'InnoDB',
172 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -320,7 +322,7 b' class Setting(Base, BaseModel):'
320
322
321
323
322 class Ui(Base, BaseModel):
324 class Ui(Base, BaseModel):
323 __tablename__ = 'rhodecode_ui'
325 __tablename__ = SETTINGS_PREFIX + 'ui'
324 __table_args__ = (
326 __table_args__ = (
325 UniqueConstraint('ui_key'),
327 UniqueConstraint('ui_key'),
326 {'extend_existing': True, 'mysql_engine': 'InnoDB',
328 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -59,6 +59,8 b' from kallithea.model.meta import Base, S'
59 URL_SEP = '/'
59 URL_SEP = '/'
60 log = logging.getLogger(__name__)
60 log = logging.getLogger(__name__)
61
61
62 from kallithea import SETTINGS_PREFIX
63
62 #==============================================================================
64 #==============================================================================
63 # BASE CLASSES
65 # BASE CLASSES
64 #==============================================================================
66 #==============================================================================
@@ -164,7 +166,7 b' class Setting(Base, BaseModel):'
164 'bool': str2bool,
166 'bool': str2bool,
165 'list': functools.partial(aslist, sep=',')
167 'list': functools.partial(aslist, sep=',')
166 }
168 }
167 __tablename__ = 'rhodecode_settings'
169 __tablename__ = SETTINGS_PREFIX + 'settings'
168 __table_args__ = (
170 __table_args__ = (
169 UniqueConstraint('app_settings_name'),
171 UniqueConstraint('app_settings_name'),
170 {'extend_existing': True, 'mysql_engine': 'InnoDB',
172 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -320,7 +322,7 b' class Setting(Base, BaseModel):'
320
322
321
323
322 class Ui(Base, BaseModel):
324 class Ui(Base, BaseModel):
323 __tablename__ = 'rhodecode_ui'
325 __tablename__ = SETTINGS_PREFIX + 'ui'
324 __table_args__ = (
326 __table_args__ = (
325 UniqueConstraint('ui_key'),
327 UniqueConstraint('ui_key'),
326 {'extend_existing': True, 'mysql_engine': 'InnoDB',
328 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -59,6 +59,8 b' from kallithea.model.meta import Base, S'
59 URL_SEP = '/'
59 URL_SEP = '/'
60 log = logging.getLogger(__name__)
60 log = logging.getLogger(__name__)
61
61
62 from kallithea import SETTINGS_PREFIX
63
62 #==============================================================================
64 #==============================================================================
63 # BASE CLASSES
65 # BASE CLASSES
64 #==============================================================================
66 #==============================================================================
@@ -157,7 +159,7 b' class BaseModel(object):'
157
159
158
160
159 class Setting(Base, BaseModel):
161 class Setting(Base, BaseModel):
160 __tablename__ = 'rhodecode_settings'
162 __tablename__ = SETTINGS_PREFIX + 'settings'
161 __table_args__ = (
163 __table_args__ = (
162 UniqueConstraint('app_settings_name'),
164 UniqueConstraint('app_settings_name'),
163 {'extend_existing': True, 'mysql_engine': 'InnoDB',
165 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -323,7 +325,7 b' class Setting(Base, BaseModel):'
323
325
324
326
325 class Ui(Base, BaseModel):
327 class Ui(Base, BaseModel):
326 __tablename__ = 'rhodecode_ui'
328 __tablename__ = SETTINGS_PREFIX + 'ui'
327 __table_args__ = (
329 __table_args__ = (
328 UniqueConstraint('ui_key'),
330 UniqueConstraint('ui_key'),
329 {'extend_existing': True, 'mysql_engine': 'InnoDB',
331 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -60,6 +60,8 b' from kallithea.model.meta import Base, S'
60 URL_SEP = '/'
60 URL_SEP = '/'
61 log = logging.getLogger(__name__)
61 log = logging.getLogger(__name__)
62
62
63 from kallithea import SETTINGS_PREFIX
64
63 #==============================================================================
65 #==============================================================================
64 # BASE CLASSES
66 # BASE CLASSES
65 #==============================================================================
67 #==============================================================================
@@ -158,7 +160,7 b' class BaseModel(object):'
158
160
159
161
160 class Setting(Base, BaseModel):
162 class Setting(Base, BaseModel):
161 __tablename__ = 'rhodecode_settings'
163 __tablename__ = SETTINGS_PREFIX + 'settings'
162 __table_args__ = (
164 __table_args__ = (
163 UniqueConstraint('app_settings_name'),
165 UniqueConstraint('app_settings_name'),
164 {'extend_existing': True, 'mysql_engine': 'InnoDB',
166 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -324,7 +326,7 b' class Setting(Base, BaseModel):'
324
326
325
327
326 class Ui(Base, BaseModel):
328 class Ui(Base, BaseModel):
327 __tablename__ = 'rhodecode_ui'
329 __tablename__ = SETTINGS_PREFIX + 'ui'
328 __table_args__ = (
330 __table_args__ = (
329 UniqueConstraint('ui_key'),
331 UniqueConstraint('ui_key'),
330 {'extend_existing': True, 'mysql_engine': 'InnoDB',
332 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -60,6 +60,8 b' from kallithea.model.meta import Base, S'
60 URL_SEP = '/'
60 URL_SEP = '/'
61 log = logging.getLogger(__name__)
61 log = logging.getLogger(__name__)
62
62
63 from kallithea import SETTINGS_PREFIX
64
63 #==============================================================================
65 #==============================================================================
64 # BASE CLASSES
66 # BASE CLASSES
65 #==============================================================================
67 #==============================================================================
@@ -158,7 +160,7 b' class BaseModel(object):'
158
160
159
161
160 class Setting(Base, BaseModel):
162 class Setting(Base, BaseModel):
161 __tablename__ = 'rhodecode_settings'
163 __tablename__ = SETTINGS_PREFIX + 'settings'
162 __table_args__ = (
164 __table_args__ = (
163 UniqueConstraint('app_settings_name'),
165 UniqueConstraint('app_settings_name'),
164 {'extend_existing': True, 'mysql_engine': 'InnoDB',
166 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -324,7 +326,7 b' class Setting(Base, BaseModel):'
324
326
325
327
326 class Ui(Base, BaseModel):
328 class Ui(Base, BaseModel):
327 __tablename__ = 'rhodecode_ui'
329 __tablename__ = SETTINGS_PREFIX + 'ui'
328 __table_args__ = (
330 __table_args__ = (
329 UniqueConstraint('ui_key'),
331 UniqueConstraint('ui_key'),
330 {'extend_existing': True, 'mysql_engine': 'InnoDB',
332 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -12,10 +12,12 b' from kallithea.model.meta import Base'
12
12
13 from kallithea.lib.dbmigrate.migrate import *
13 from kallithea.lib.dbmigrate.migrate import *
14
14
15 from kallithea import SETTINGS_PREFIX
16
15 log = logging.getLogger(__name__)
17 log = logging.getLogger(__name__)
16
18
17 class Setting(Base):
19 class Setting(Base):
18 __tablename__ = 'rhodecode_settings'
20 __tablename__ = SETTINGS_PREFIX + 'settings'
19 __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True})
21 __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True})
20 app_settings_id = Column("app_settings_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
22 app_settings_id = Column("app_settings_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
21 app_settings_name = Column("app_settings_name", String(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
23 app_settings_name = Column("app_settings_name", String(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
@@ -30,7 +32,7 b' class Setting(Base):'
30 self.app_settings_value)
32 self.app_settings_value)
31
33
32 class Ui(Base):
34 class Ui(Base):
33 __tablename__ = 'rhodecode_ui'
35 __tablename__ = SETTINGS_PREFIX + 'ui'
34 __table_args__ = {'useexisting':True}
36 __table_args__ = {'useexisting':True}
35 ui_id = Column("ui_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
37 ui_id = Column("ui_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
36 ui_section = Column("ui_section", String(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
38 ui_section = Column("ui_section", String(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
@@ -57,6 +57,8 b' from kallithea.lib.caching_query import '
57
57
58 from kallithea.model.meta import Base, Session
58 from kallithea.model.meta import Base, Session
59
59
60 from kallithea import SETTINGS_PREFIX
61
60 URL_SEP = '/'
62 URL_SEP = '/'
61 log = logging.getLogger(__name__)
63 log = logging.getLogger(__name__)
62
64
@@ -158,7 +160,8 b' class BaseModel(object):'
158
160
159
161
160 class Setting(Base, BaseModel):
162 class Setting(Base, BaseModel):
161 __tablename__ = 'rhodecode_settings'
163 __tablename__ = SETTINGS_PREFIX + 'settings'
164
162 __table_args__ = (
165 __table_args__ = (
163 UniqueConstraint('app_settings_name'),
166 UniqueConstraint('app_settings_name'),
164 {'extend_existing': True, 'mysql_engine': 'InnoDB',
167 {'extend_existing': True, 'mysql_engine': 'InnoDB',
@@ -324,7 +327,7 b' class Setting(Base, BaseModel):'
324
327
325
328
326 class Ui(Base, BaseModel):
329 class Ui(Base, BaseModel):
327 __tablename__ = 'rhodecode_ui'
330 __tablename__ = SETTINGS_PREFIX + 'ui'
328 __table_args__ = (
331 __table_args__ = (
329 UniqueConstraint('ui_key'),
332 UniqueConstraint('ui_key'),
330 {'extend_existing': True, 'mysql_engine': 'InnoDB',
333 {'extend_existing': True, 'mysql_engine': 'InnoDB',
General Comments 0
You need to be logged in to leave comments. Login now