|
@@
-151,7
+151,8
b' class RhodeCodeSetting(Base, BaseModel):'
|
|
151
|
__tablename__ = 'rhodecode_settings'
|
|
151
|
__tablename__ = 'rhodecode_settings'
|
|
152
|
__table_args__ = (
|
|
152
|
__table_args__ = (
|
|
153
|
UniqueConstraint('app_settings_name'),
|
|
153
|
UniqueConstraint('app_settings_name'),
|
|
154
|
{'extend_existing': True}
|
|
154
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
155
|
'mysql_charset': 'utf8'}
|
|
155
|
)
|
|
156
|
)
|
|
156
|
app_settings_id = Column("app_settings_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
157
|
app_settings_id = Column("app_settings_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
157
|
app_settings_name = Column("app_settings_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
158
|
app_settings_name = Column("app_settings_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
@@
-225,7
+226,8
b' class RhodeCodeUi(Base, BaseModel):'
|
|
225
|
__tablename__ = 'rhodecode_ui'
|
|
226
|
__tablename__ = 'rhodecode_ui'
|
|
226
|
__table_args__ = (
|
|
227
|
__table_args__ = (
|
|
227
|
UniqueConstraint('ui_key'),
|
|
228
|
UniqueConstraint('ui_key'),
|
|
228
|
{'extend_existing': True}
|
|
229
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
230
|
'mysql_charset': 'utf8'}
|
|
229
|
)
|
|
231
|
)
|
|
230
|
|
|
232
|
|
|
231
|
HOOK_UPDATE = 'changegroup.update'
|
|
233
|
HOOK_UPDATE = 'changegroup.update'
|
|
@@
-275,7
+277,8
b' class User(Base, BaseModel):'
|
|
275
|
__tablename__ = 'users'
|
|
277
|
__tablename__ = 'users'
|
|
276
|
__table_args__ = (
|
|
278
|
__table_args__ = (
|
|
277
|
UniqueConstraint('username'), UniqueConstraint('email'),
|
|
279
|
UniqueConstraint('username'), UniqueConstraint('email'),
|
|
278
|
{'extend_existing': True}
|
|
280
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
281
|
'mysql_charset': 'utf8'}
|
|
279
|
)
|
|
282
|
)
|
|
280
|
user_id = Column("user_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
283
|
user_id = Column("user_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
281
|
username = Column("username", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
284
|
username = Column("username", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
@@
-295,7
+298,8
b' class User(Base, BaseModel):'
|
|
295
|
repositories = relationship('Repository')
|
|
298
|
repositories = relationship('Repository')
|
|
296
|
user_followers = relationship('UserFollowing', primaryjoin='UserFollowing.follows_user_id==User.user_id', cascade='all')
|
|
299
|
user_followers = relationship('UserFollowing', primaryjoin='UserFollowing.follows_user_id==User.user_id', cascade='all')
|
|
297
|
repo_to_perm = relationship('UserRepoToPerm', primaryjoin='UserRepoToPerm.user_id==User.user_id', cascade='all')
|
|
300
|
repo_to_perm = relationship('UserRepoToPerm', primaryjoin='UserRepoToPerm.user_id==User.user_id', cascade='all')
|
|
298
|
|
|
301
|
repo_group_to_perm = relationship('UserRepoGroupToPerm', primaryjoin='UserRepoGroupToPerm.user_id==User.user_id', cascade='all')
|
|
|
|
|
302
|
|
|
299
|
group_member = relationship('UsersGroupMember', cascade='all')
|
|
303
|
group_member = relationship('UsersGroupMember', cascade='all')
|
|
300
|
|
|
304
|
|
|
301
|
notifications = relationship('UserNotification',)
|
|
305
|
notifications = relationship('UserNotification',)
|
|
@@
-387,7
+391,10
b' class User(Base, BaseModel):'
|
|
387
|
|
|
391
|
|
|
388
|
class UserLog(Base, BaseModel):
|
|
392
|
class UserLog(Base, BaseModel):
|
|
389
|
__tablename__ = 'user_logs'
|
|
393
|
__tablename__ = 'user_logs'
|
|
390
|
__table_args__ = {'extend_existing': True}
|
|
394
|
__table_args__ = (
|
|
|
|
|
395
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
396
|
'mysql_charset': 'utf8'},
|
|
|
|
|
397
|
)
|
|
391
|
user_log_id = Column("user_log_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
398
|
user_log_id = Column("user_log_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
392
|
user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
|
|
399
|
user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
|
|
393
|
repository_id = Column("repository_id", Integer(), ForeignKey('repositories.repo_id'), nullable=True)
|
|
400
|
repository_id = Column("repository_id", Integer(), ForeignKey('repositories.repo_id'), nullable=True)
|
|
@@
-406,7
+413,10
b' class UserLog(Base, BaseModel):'
|
|
406
|
|
|
413
|
|
|
407
|
class UsersGroup(Base, BaseModel):
|
|
414
|
class UsersGroup(Base, BaseModel):
|
|
408
|
__tablename__ = 'users_groups'
|
|
415
|
__tablename__ = 'users_groups'
|
|
409
|
__table_args__ = {'extend_existing': True}
|
|
416
|
__table_args__ = (
|
|
|
|
|
417
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
418
|
'mysql_charset': 'utf8'},
|
|
|
|
|
419
|
)
|
|
410
|
|
|
420
|
|
|
411
|
users_group_id = Column("users_group_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
421
|
users_group_id = Column("users_group_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
412
|
users_group_name = Column("users_group_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=False, unique=True, default=None)
|
|
422
|
users_group_name = Column("users_group_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=False, unique=True, default=None)
|
|
@@
-414,6
+424,7
b' class UsersGroup(Base, BaseModel):'
|
|
414
|
|
|
424
|
|
|
415
|
members = relationship('UsersGroupMember', cascade="all, delete, delete-orphan", lazy="joined")
|
|
425
|
members = relationship('UsersGroupMember', cascade="all, delete, delete-orphan", lazy="joined")
|
|
416
|
users_group_to_perm = relationship('UsersGroupToPerm', cascade='all')
|
|
426
|
users_group_to_perm = relationship('UsersGroupToPerm', cascade='all')
|
|
|
|
|
427
|
users_group_repo_to_perm = relationship('UsersGroupRepoToPerm', cascade='all')
|
|
417
|
|
|
428
|
|
|
418
|
def __repr__(self):
|
|
429
|
def __repr__(self):
|
|
419
|
return '<userGroup(%s)>' % (self.users_group_name)
|
|
430
|
return '<userGroup(%s)>' % (self.users_group_name)
|
|
@@
-444,7
+455,10
b' class UsersGroup(Base, BaseModel):'
|
|
444
|
|
|
455
|
|
|
445
|
class UsersGroupMember(Base, BaseModel):
|
|
456
|
class UsersGroupMember(Base, BaseModel):
|
|
446
|
__tablename__ = 'users_groups_members'
|
|
457
|
__tablename__ = 'users_groups_members'
|
|
447
|
__table_args__ = {'extend_existing': True}
|
|
458
|
__table_args__ = (
|
|
|
|
|
459
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
460
|
'mysql_charset': 'utf8'},
|
|
|
|
|
461
|
)
|
|
448
|
|
|
462
|
|
|
449
|
users_group_member_id = Column("users_group_member_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
463
|
users_group_member_id = Column("users_group_member_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
450
|
users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
|
|
464
|
users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
|
|
@@
-462,7
+476,8
b' class Repository(Base, BaseModel):'
|
|
462
|
__tablename__ = 'repositories'
|
|
476
|
__tablename__ = 'repositories'
|
|
463
|
__table_args__ = (
|
|
477
|
__table_args__ = (
|
|
464
|
UniqueConstraint('repo_name'),
|
|
478
|
UniqueConstraint('repo_name'),
|
|
465
|
{'extend_existing': True},
|
|
479
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
480
|
'mysql_charset': 'utf8'},
|
|
466
|
)
|
|
481
|
)
|
|
467
|
|
|
482
|
|
|
468
|
repo_id = Column("repo_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
483
|
repo_id = Column("repo_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
@@
-711,7
+726,8
b' class RepoGroup(Base, BaseModel):'
|
|
711
|
__table_args__ = (
|
|
726
|
__table_args__ = (
|
|
712
|
UniqueConstraint('group_name', 'group_parent_id'),
|
|
727
|
UniqueConstraint('group_name', 'group_parent_id'),
|
|
713
|
CheckConstraint('group_id != group_parent_id'),
|
|
728
|
CheckConstraint('group_id != group_parent_id'),
|
|
714
|
{'extend_existing': True},
|
|
729
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
730
|
'mysql_charset': 'utf8'},
|
|
715
|
)
|
|
731
|
)
|
|
716
|
__mapper_args__ = {'order_by': 'group_name'}
|
|
732
|
__mapper_args__ = {'order_by': 'group_name'}
|
|
717
|
|
|
733
|
|
|
@@
-838,7
+854,10
b' class RepoGroup(Base, BaseModel):'
|
|
838
|
|
|
854
|
|
|
839
|
class Permission(Base, BaseModel):
|
|
855
|
class Permission(Base, BaseModel):
|
|
840
|
__tablename__ = 'permissions'
|
|
856
|
__tablename__ = 'permissions'
|
|
841
|
__table_args__ = {'extend_existing': True}
|
|
857
|
__table_args__ = (
|
|
|
|
|
858
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
859
|
'mysql_charset': 'utf8'},
|
|
|
|
|
860
|
)
|
|
842
|
permission_id = Column("permission_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
861
|
permission_id = Column("permission_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
843
|
permission_name = Column("permission_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
862
|
permission_name = Column("permission_name", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
844
|
permission_longname = Column("permission_longname", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
863
|
permission_longname = Column("permission_longname", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
@@
-875,7
+894,8
b' class UserRepoToPerm(Base, BaseModel):'
|
|
875
|
__tablename__ = 'repo_to_perm'
|
|
894
|
__tablename__ = 'repo_to_perm'
|
|
876
|
__table_args__ = (
|
|
895
|
__table_args__ = (
|
|
877
|
UniqueConstraint('user_id', 'repository_id', 'permission_id'),
|
|
896
|
UniqueConstraint('user_id', 'repository_id', 'permission_id'),
|
|
878
|
{'extend_existing': True}
|
|
897
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
898
|
'mysql_charset': 'utf8'}
|
|
879
|
)
|
|
899
|
)
|
|
880
|
repo_to_perm_id = Column("repo_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
900
|
repo_to_perm_id = Column("repo_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
881
|
user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
|
|
901
|
user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
|
|
@@
-903,7
+923,8
b' class UserToPerm(Base, BaseModel):'
|
|
903
|
__tablename__ = 'user_to_perm'
|
|
923
|
__tablename__ = 'user_to_perm'
|
|
904
|
__table_args__ = (
|
|
924
|
__table_args__ = (
|
|
905
|
UniqueConstraint('user_id', 'permission_id'),
|
|
925
|
UniqueConstraint('user_id', 'permission_id'),
|
|
906
|
{'extend_existing': True}
|
|
926
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
927
|
'mysql_charset': 'utf8'}
|
|
907
|
)
|
|
928
|
)
|
|
908
|
user_to_perm_id = Column("user_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
929
|
user_to_perm_id = Column("user_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
909
|
user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
|
|
930
|
user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
|
|
@@
-917,7
+938,8
b' class UsersGroupRepoToPerm(Base, BaseMod'
|
|
917
|
__tablename__ = 'users_group_repo_to_perm'
|
|
938
|
__tablename__ = 'users_group_repo_to_perm'
|
|
918
|
__table_args__ = (
|
|
939
|
__table_args__ = (
|
|
919
|
UniqueConstraint('repository_id', 'users_group_id', 'permission_id'),
|
|
940
|
UniqueConstraint('repository_id', 'users_group_id', 'permission_id'),
|
|
920
|
{'extend_existing': True}
|
|
941
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
942
|
'mysql_charset': 'utf8'}
|
|
921
|
)
|
|
943
|
)
|
|
922
|
users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
944
|
users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
923
|
users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
|
|
945
|
users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
|
|
@@
-945,7
+967,8
b' class UsersGroupToPerm(Base, BaseModel):'
|
|
945
|
__tablename__ = 'users_group_to_perm'
|
|
967
|
__tablename__ = 'users_group_to_perm'
|
|
946
|
__table_args__ = (
|
|
968
|
__table_args__ = (
|
|
947
|
UniqueConstraint('users_group_id', 'permission_id',),
|
|
969
|
UniqueConstraint('users_group_id', 'permission_id',),
|
|
948
|
{'extend_existing': True}
|
|
970
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
971
|
'mysql_charset': 'utf8'}
|
|
949
|
)
|
|
972
|
)
|
|
950
|
users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
973
|
users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
951
|
users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
|
|
974
|
users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
|
|
@@
-959,7
+982,8
b' class UserRepoGroupToPerm(Base, BaseMode'
|
|
959
|
__tablename__ = 'user_repo_group_to_perm'
|
|
982
|
__tablename__ = 'user_repo_group_to_perm'
|
|
960
|
__table_args__ = (
|
|
983
|
__table_args__ = (
|
|
961
|
UniqueConstraint('user_id', 'group_id', 'permission_id'),
|
|
984
|
UniqueConstraint('user_id', 'group_id', 'permission_id'),
|
|
962
|
{'extend_existing': True}
|
|
985
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
986
|
'mysql_charset': 'utf8'}
|
|
963
|
)
|
|
987
|
)
|
|
964
|
|
|
988
|
|
|
965
|
group_to_perm_id = Column("group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
989
|
group_to_perm_id = Column("group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
@@
-976,7
+1000,8
b' class UsersGroupRepoGroupToPerm(Base, Ba'
|
|
976
|
__tablename__ = 'users_group_repo_group_to_perm'
|
|
1000
|
__tablename__ = 'users_group_repo_group_to_perm'
|
|
977
|
__table_args__ = (
|
|
1001
|
__table_args__ = (
|
|
978
|
UniqueConstraint('users_group_id', 'group_id'),
|
|
1002
|
UniqueConstraint('users_group_id', 'group_id'),
|
|
979
|
{'extend_existing': True}
|
|
1003
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
1004
|
'mysql_charset': 'utf8'}
|
|
980
|
)
|
|
1005
|
)
|
|
981
|
|
|
1006
|
|
|
982
|
users_group_repo_group_to_perm_id = Column("users_group_repo_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
1007
|
users_group_repo_group_to_perm_id = Column("users_group_repo_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
@@
-991,7
+1016,11
b' class UsersGroupRepoGroupToPerm(Base, Ba'
|
|
991
|
|
|
1016
|
|
|
992
|
class Statistics(Base, BaseModel):
|
|
1017
|
class Statistics(Base, BaseModel):
|
|
993
|
__tablename__ = 'statistics'
|
|
1018
|
__tablename__ = 'statistics'
|
|
994
|
__table_args__ = (UniqueConstraint('repository_id'), {'extend_existing': True})
|
|
1019
|
__table_args__ = (
|
|
|
|
|
1020
|
UniqueConstraint('repository_id'),
|
|
|
|
|
1021
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
1022
|
'mysql_charset': 'utf8'}
|
|
|
|
|
1023
|
)
|
|
995
|
stat_id = Column("stat_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
1024
|
stat_id = Column("stat_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
996
|
repository_id = Column("repository_id", Integer(), ForeignKey('repositories.repo_id'), nullable=False, unique=True, default=None)
|
|
1025
|
repository_id = Column("repository_id", Integer(), ForeignKey('repositories.repo_id'), nullable=False, unique=True, default=None)
|
|
997
|
stat_on_revision = Column("stat_on_revision", Integer(), nullable=False)
|
|
1026
|
stat_on_revision = Column("stat_on_revision", Integer(), nullable=False)
|
|
@@
-1007,7
+1036,8
b' class UserFollowing(Base, BaseModel):'
|
|
1007
|
__table_args__ = (
|
|
1036
|
__table_args__ = (
|
|
1008
|
UniqueConstraint('user_id', 'follows_repository_id'),
|
|
1037
|
UniqueConstraint('user_id', 'follows_repository_id'),
|
|
1009
|
UniqueConstraint('user_id', 'follows_user_id'),
|
|
1038
|
UniqueConstraint('user_id', 'follows_user_id'),
|
|
1010
|
{'extend_existing': True}
|
|
1039
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
1040
|
'mysql_charset': 'utf8'}
|
|
1011
|
)
|
|
1041
|
)
|
|
1012
|
|
|
1042
|
|
|
1013
|
user_following_id = Column("user_following_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
1043
|
user_following_id = Column("user_following_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
@@
-1028,7
+1058,11
b' class UserFollowing(Base, BaseModel):'
|
|
1028
|
|
|
1058
|
|
|
1029
|
class CacheInvalidation(Base, BaseModel):
|
|
1059
|
class CacheInvalidation(Base, BaseModel):
|
|
1030
|
__tablename__ = 'cache_invalidation'
|
|
1060
|
__tablename__ = 'cache_invalidation'
|
|
1031
|
__table_args__ = (UniqueConstraint('cache_key'), {'extend_existing': True})
|
|
1061
|
__table_args__ = (
|
|
|
|
|
1062
|
UniqueConstraint('cache_key'),
|
|
|
|
|
1063
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
1064
|
'mysql_charset': 'utf8'},
|
|
|
|
|
1065
|
)
|
|
1032
|
cache_id = Column("cache_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
1066
|
cache_id = Column("cache_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
|
|
1033
|
cache_key = Column("cache_key", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
1067
|
cache_key = Column("cache_key", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
1034
|
cache_args = Column("cache_args", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
1068
|
cache_args = Column("cache_args", String(length=255, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
|
|
@@
-1063,7
+1097,7
b' class CacheInvalidation(Base, BaseModel)'
|
|
1063
|
@classmethod
|
|
1097
|
@classmethod
|
|
1064
|
def get_by_key(cls, key):
|
|
1098
|
def get_by_key(cls, key):
|
|
1065
|
return cls.query().filter(cls.cache_key == key).scalar()
|
|
1099
|
return cls.query().filter(cls.cache_key == key).scalar()
|
|
1066
|
|
|
1100
|
|
|
1067
|
@classmethod
|
|
1101
|
@classmethod
|
|
1068
|
def _get_or_create_key(cls, key, prefix, org_key):
|
|
1102
|
def _get_or_create_key(cls, key, prefix, org_key):
|
|
1069
|
inv_obj = Session.query(cls).filter(cls.cache_key == key).scalar()
|
|
1103
|
inv_obj = Session.query(cls).filter(cls.cache_key == key).scalar()
|
|
@@
-1074,9
+1108,9
b' class CacheInvalidation(Base, BaseModel)'
|
|
1074
|
Session.commit()
|
|
1108
|
Session.commit()
|
|
1075
|
except Exception:
|
|
1109
|
except Exception:
|
|
1076
|
log.error(traceback.format_exc())
|
|
1110
|
log.error(traceback.format_exc())
|
|
1077
|
Session.rollback()
|
|
1111
|
Session.rollback()
|
|
1078
|
return inv_obj
|
|
1112
|
return inv_obj
|
|
1079
|
|
|
1113
|
|
|
1080
|
@classmethod
|
|
1114
|
@classmethod
|
|
1081
|
def invalidate(cls, key):
|
|
1115
|
def invalidate(cls, key):
|
|
1082
|
"""
|
|
1116
|
"""
|
|
@@
-1086,7
+1120,7
b' class CacheInvalidation(Base, BaseModel)'
|
|
1086
|
|
|
1120
|
|
|
1087
|
:param key:
|
|
1121
|
:param key:
|
|
1088
|
"""
|
|
1122
|
"""
|
|
1089
|
|
|
1123
|
|
|
1090
|
key, _prefix, _org_key = cls._get_key(key)
|
|
1124
|
key, _prefix, _org_key = cls._get_key(key)
|
|
1091
|
inv = cls._get_or_create_key(key, _prefix, _org_key)
|
|
1125
|
inv = cls._get_or_create_key(key, _prefix, _org_key)
|
|
1092
|
|
|
1126
|
|
|
@@
-1131,7
+1165,10
b' class CacheInvalidation(Base, BaseModel)'
|
|
1131
|
|
|
1165
|
|
|
1132
|
class ChangesetComment(Base, BaseModel):
|
|
1166
|
class ChangesetComment(Base, BaseModel):
|
|
1133
|
__tablename__ = 'changeset_comments'
|
|
1167
|
__tablename__ = 'changeset_comments'
|
|
1134
|
__table_args__ = ({'extend_existing': True},)
|
|
1168
|
__table_args__ = (
|
|
|
|
|
1169
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
1170
|
'mysql_charset': 'utf8'},
|
|
|
|
|
1171
|
)
|
|
1135
|
comment_id = Column('comment_id', Integer(), nullable=False, primary_key=True)
|
|
1172
|
comment_id = Column('comment_id', Integer(), nullable=False, primary_key=True)
|
|
1136
|
repo_id = Column('repo_id', Integer(), ForeignKey('repositories.repo_id'), nullable=False)
|
|
1173
|
repo_id = Column('repo_id', Integer(), ForeignKey('repositories.repo_id'), nullable=False)
|
|
1137
|
revision = Column('revision', String(40), nullable=False)
|
|
1174
|
revision = Column('revision', String(40), nullable=False)
|
|
@@
-1160,7
+1197,10
b' class ChangesetComment(Base, BaseModel):'
|
|
1160
|
|
|
1197
|
|
|
1161
|
class Notification(Base, BaseModel):
|
|
1198
|
class Notification(Base, BaseModel):
|
|
1162
|
__tablename__ = 'notifications'
|
|
1199
|
__tablename__ = 'notifications'
|
|
1163
|
__table_args__ = ({'extend_existing': True},)
|
|
1200
|
__table_args__ = (
|
|
|
|
|
1201
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
1202
|
'mysql_charset': 'utf8'},
|
|
|
|
|
1203
|
)
|
|
1164
|
|
|
1204
|
|
|
1165
|
TYPE_CHANGESET_COMMENT = u'cs_comment'
|
|
1205
|
TYPE_CHANGESET_COMMENT = u'cs_comment'
|
|
1166
|
TYPE_MESSAGE = u'message'
|
|
1206
|
TYPE_MESSAGE = u'message'
|
|
@@
-1212,7
+1252,8
b' class UserNotification(Base, BaseModel):'
|
|
1212
|
__tablename__ = 'user_to_notification'
|
|
1252
|
__tablename__ = 'user_to_notification'
|
|
1213
|
__table_args__ = (
|
|
1253
|
__table_args__ = (
|
|
1214
|
UniqueConstraint('user_id', 'notification_id'),
|
|
1254
|
UniqueConstraint('user_id', 'notification_id'),
|
|
1215
|
{'extend_existing': True}
|
|
1255
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
1256
|
'mysql_charset': 'utf8'}
|
|
1216
|
)
|
|
1257
|
)
|
|
1217
|
user_id = Column('user_id', Integer(), ForeignKey('users.user_id'), primary_key=True)
|
|
1258
|
user_id = Column('user_id', Integer(), ForeignKey('users.user_id'), primary_key=True)
|
|
1218
|
notification_id = Column("notification_id", Integer(), ForeignKey('notifications.notification_id'), primary_key=True)
|
|
1259
|
notification_id = Column("notification_id", Integer(), ForeignKey('notifications.notification_id'), primary_key=True)
|
|
@@
-1230,7
+1271,10
b' class UserNotification(Base, BaseModel):'
|
|
1230
|
|
|
1271
|
|
|
1231
|
class DbMigrateVersion(Base, BaseModel):
|
|
1272
|
class DbMigrateVersion(Base, BaseModel):
|
|
1232
|
__tablename__ = 'db_migrate_version'
|
|
1273
|
__tablename__ = 'db_migrate_version'
|
|
1233
|
__table_args__ = {'extend_existing': True}
|
|
1274
|
__table_args__ = (
|
|
|
|
|
1275
|
{'extend_existing': True, 'mysql_engine':'InnoDB',
|
|
|
|
|
1276
|
'mysql_charset': 'utf8'},
|
|
|
|
|
1277
|
)
|
|
1234
|
repository_id = Column('repository_id', String(250), primary_key=True)
|
|
1278
|
repository_id = Column('repository_id', String(250), primary_key=True)
|
|
1235
|
repository_path = Column('repository_path', Text)
|
|
1279
|
repository_path = Column('repository_path', Text)
|
|
1236
|
version = Column('version', Integer)
|
|
1280
|
version = Column('version', Integer)
|