Show More
@@ -31,12 +31,21 b' from datetime import date' | |||||
31 | from sqlalchemy import * |
|
31 | from sqlalchemy import * | |
32 | from sqlalchemy.exc import DatabaseError |
|
32 | from sqlalchemy.exc import DatabaseError | |
33 | from sqlalchemy.orm import relationship, backref |
|
33 | from sqlalchemy.orm import relationship, backref | |
34 |
from sqlalchemy.orm. |
|
34 | from sqlalchemy.orm.interfaces import MapperExtension | |
35 |
|
35 | |||
36 | from rhodecode.model.meta import Base |
|
36 | from rhodecode.model.meta import Base, Session | |
37 |
|
37 | |||
38 | log = logging.getLogger(__name__) |
|
38 | log = logging.getLogger(__name__) | |
39 |
|
39 | |||
|
40 | #============================================================================== | |||
|
41 | # MAPPER EXTENSIONS | |||
|
42 | #============================================================================== | |||
|
43 | ||||
|
44 | class RepositoryMapper(MapperExtension): | |||
|
45 | def after_update(self, mapper, connection, instance): | |||
|
46 | pass | |||
|
47 | ||||
|
48 | ||||
40 | class RhodeCodeSettings(Base): |
|
49 | class RhodeCodeSettings(Base): | |
41 | __tablename__ = 'rhodecode_settings' |
|
50 | __tablename__ = 'rhodecode_settings' | |
42 | __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True}) |
|
51 | __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True}) | |
@@ -161,6 +170,8 b' class UsersGroupMember(Base):' | |||||
161 | class Repository(Base): |
|
170 | class Repository(Base): | |
162 | __tablename__ = 'repositories' |
|
171 | __tablename__ = 'repositories' | |
163 | __table_args__ = (UniqueConstraint('repo_name'), {'useexisting':True},) |
|
172 | __table_args__ = (UniqueConstraint('repo_name'), {'useexisting':True},) | |
|
173 | __mapper_args__ = {'extension':RepositoryMapper()} | |||
|
174 | ||||
164 | repo_id = Column("repo_id", Integer(), nullable=False, unique=True, default=None, primary_key=True) |
|
175 | repo_id = Column("repo_id", Integer(), nullable=False, unique=True, default=None, primary_key=True) | |
165 | repo_name = Column("repo_name", String(length=None, convert_unicode=False, assert_unicode=None), nullable=False, unique=True, default=None) |
|
176 | repo_name = Column("repo_name", String(length=None, convert_unicode=False, assert_unicode=None), nullable=False, unique=True, default=None) | |
166 | repo_type = Column("repo_type", String(length=None, convert_unicode=False, assert_unicode=None), nullable=False, unique=False, default='hg') |
|
177 | repo_type = Column("repo_type", String(length=None, convert_unicode=False, assert_unicode=None), nullable=False, unique=False, default='hg') |
General Comments 0
You need to be logged in to leave comments.
Login now