##// END OF EJS Templates
db: use base table args for all models defined.
marcink -
r2830:151c8101 default
parent child Browse files
Show More
@@ -140,6 +140,14 b' def in_filter_generator(qry, items, limi'
140 return parts
140 return parts
141
141
142
142
143 base_table_args = {
144 'extend_existing': True,
145 'mysql_engine': 'InnoDB',
146 'mysql_charset': 'utf8',
147 'sqlite_autoincrement': True
148 }
149
150
143 class EncryptedTextValue(TypeDecorator):
151 class EncryptedTextValue(TypeDecorator):
144 """
152 """
145 Special column for encrypted long text data, use like::
153 Special column for encrypted long text data, use like::
@@ -302,8 +310,7 b' class RhodeCodeSetting(Base, BaseModel):'
302 __tablename__ = 'rhodecode_settings'
310 __tablename__ = 'rhodecode_settings'
303 __table_args__ = (
311 __table_args__ = (
304 UniqueConstraint('app_settings_name'),
312 UniqueConstraint('app_settings_name'),
305 {'extend_existing': True, 'mysql_engine': 'InnoDB',
313 base_table_args
306 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
307 )
314 )
308
315
309 SETTINGS_TYPES = {
316 SETTINGS_TYPES = {
@@ -383,8 +390,7 b' class RhodeCodeUi(Base, BaseModel):'
383 __tablename__ = 'rhodecode_ui'
390 __tablename__ = 'rhodecode_ui'
384 __table_args__ = (
391 __table_args__ = (
385 UniqueConstraint('ui_key'),
392 UniqueConstraint('ui_key'),
386 {'extend_existing': True, 'mysql_engine': 'InnoDB',
393 base_table_args
387 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
388 )
394 )
389
395
390 HOOK_REPO_SIZE = 'changegroup.repo_size'
396 HOOK_REPO_SIZE = 'changegroup.repo_size'
@@ -426,8 +432,7 b' class RepoRhodeCodeSetting(Base, BaseMod'
426 UniqueConstraint(
432 UniqueConstraint(
427 'app_settings_name', 'repository_id',
433 'app_settings_name', 'repository_id',
428 name='uq_repo_rhodecode_setting_name_repo_id'),
434 name='uq_repo_rhodecode_setting_name_repo_id'),
429 {'extend_existing': True, 'mysql_engine': 'InnoDB',
435 base_table_args
430 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
431 )
436 )
432
437
433 repository_id = Column(
438 repository_id = Column(
@@ -502,8 +507,7 b' class RepoRhodeCodeUi(Base, BaseModel):'
502 UniqueConstraint(
507 UniqueConstraint(
503 'repository_id', 'ui_section', 'ui_key',
508 'repository_id', 'ui_section', 'ui_key',
504 name='uq_repo_rhodecode_ui_repository_id_section_key'),
509 name='uq_repo_rhodecode_ui_repository_id_section_key'),
505 {'extend_existing': True, 'mysql_engine': 'InnoDB',
510 base_table_args
506 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
507 )
511 )
508
512
509 repository_id = Column(
513 repository_id = Column(
@@ -535,9 +539,9 b' class User(Base, BaseModel):'
535 UniqueConstraint('username'), UniqueConstraint('email'),
539 UniqueConstraint('username'), UniqueConstraint('email'),
536 Index('u_username_idx', 'username'),
540 Index('u_username_idx', 'username'),
537 Index('u_email_idx', 'email'),
541 Index('u_email_idx', 'email'),
538 {'extend_existing': True, 'mysql_engine': 'InnoDB',
542 base_table_args
539 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
540 )
543 )
544
541 DEFAULT_USER = 'default'
545 DEFAULT_USER = 'default'
542 DEFAULT_USER_EMAIL = 'anonymous@rhodecode.org'
546 DEFAULT_USER_EMAIL = 'anonymous@rhodecode.org'
543 DEFAULT_GRAVATAR_URL = 'https://secure.gravatar.com/avatar/{md5email}?d=identicon&s={size}'
547 DEFAULT_GRAVATAR_URL = 'https://secure.gravatar.com/avatar/{md5email}?d=identicon&s={size}'
@@ -1034,8 +1038,7 b' class UserApiKeys(Base, BaseModel):'
1034 __table_args__ = (
1038 __table_args__ = (
1035 Index('uak_api_key_idx', 'api_key', unique=True),
1039 Index('uak_api_key_idx', 'api_key', unique=True),
1036 Index('uak_api_key_expires_idx', 'api_key', 'expires'),
1040 Index('uak_api_key_expires_idx', 'api_key', 'expires'),
1037 {'extend_existing': True, 'mysql_engine': 'InnoDB',
1041 base_table_args
1038 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
1039 )
1042 )
1040 __mapper_args__ = {}
1043 __mapper_args__ = {}
1041
1044
@@ -1137,8 +1140,7 b' class UserEmailMap(Base, BaseModel):'
1137 __table_args__ = (
1140 __table_args__ = (
1138 Index('uem_email_idx', 'email'),
1141 Index('uem_email_idx', 'email'),
1139 UniqueConstraint('email'),
1142 UniqueConstraint('email'),
1140 {'extend_existing': True, 'mysql_engine': 'InnoDB',
1143 base_table_args
1141 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
1142 )
1144 )
1143 __mapper_args__ = {}
1145 __mapper_args__ = {}
1144
1146
@@ -1168,8 +1170,7 b' class UserIpMap(Base, BaseModel):'
1168 __tablename__ = 'user_ip_map'
1170 __tablename__ = 'user_ip_map'
1169 __table_args__ = (
1171 __table_args__ = (
1170 UniqueConstraint('user_id', 'ip_addr'),
1172 UniqueConstraint('user_id', 'ip_addr'),
1171 {'extend_existing': True, 'mysql_engine': 'InnoDB',
1173 base_table_args
1172 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
1173 )
1174 )
1174 __mapper_args__ = {}
1175 __mapper_args__ = {}
1175
1176
@@ -1208,8 +1209,7 b' class UserSshKeys(Base, BaseModel):'
1208
1209
1209 UniqueConstraint('ssh_key_fingerprint'),
1210 UniqueConstraint('ssh_key_fingerprint'),
1210
1211
1211 {'extend_existing': True, 'mysql_engine': 'InnoDB',
1212 base_table_args
1212 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
1213 )
1213 )
1214 __mapper_args__ = {}
1214 __mapper_args__ = {}
1215
1215
@@ -1241,9 +1241,9 b' class UserSshKeys(Base, BaseModel):'
1241 class UserLog(Base, BaseModel):
1241 class UserLog(Base, BaseModel):
1242 __tablename__ = 'user_logs'
1242 __tablename__ = 'user_logs'
1243 __table_args__ = (
1243 __table_args__ = (
1244 {'extend_existing': True, 'mysql_engine': 'InnoDB',
1244 base_table_args,
1245 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
1246 )
1245 )
1246
1247 VERSION_1 = 'v1'
1247 VERSION_1 = 'v1'
1248 VERSION_2 = 'v2'
1248 VERSION_2 = 'v2'
1249 VERSIONS = [VERSION_1, VERSION_2]
1249 VERSIONS = [VERSION_1, VERSION_2]
@@ -1291,8 +1291,7 b' class UserLog(Base, BaseModel):'
1291 class UserGroup(Base, BaseModel):
1291 class UserGroup(Base, BaseModel):
1292 __tablename__ = 'users_groups'
1292 __tablename__ = 'users_groups'
1293 __table_args__ = (
1293 __table_args__ = (
1294 {'extend_existing': True, 'mysql_engine': 'InnoDB',
1294 base_table_args,
1295 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
1296 )
1295 )
1297
1296
1298 users_group_id = Column("users_group_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
1297 users_group_id = Column("users_group_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
@@ -1479,8 +1478,7 b' class UserGroup(Base, BaseModel):'
1479 class UserGroupMember(Base, BaseModel):
1478 class UserGroupMember(Base, BaseModel):
1480 __tablename__ = 'users_groups_members'
1479 __tablename__ = 'users_groups_members'
1481 __table_args__ = (
1480 __table_args__ = (
1482 {'extend_existing': True, 'mysql_engine': 'InnoDB',
1481 base_table_args,
1483 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
1484 )
1482 )
1485
1483
1486 users_group_member_id = Column("users_group_member_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
1484 users_group_member_id = Column("users_group_member_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
@@ -1499,9 +1497,9 b' class RepositoryField(Base, BaseModel):'
1499 __tablename__ = 'repositories_fields'
1497 __tablename__ = 'repositories_fields'
1500 __table_args__ = (
1498 __table_args__ = (
1501 UniqueConstraint('repository_id', 'field_key'), # no-multi field
1499 UniqueConstraint('repository_id', 'field_key'), # no-multi field
1502 {'extend_existing': True, 'mysql_engine': 'InnoDB',
1500 base_table_args,
1503 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
1504 )
1501 )
1502
1505 PREFIX = 'ex_' # prefix used in form to not conflict with already existing fields
1503 PREFIX = 'ex_' # prefix used in form to not conflict with already existing fields
1506
1504
1507 repo_field_id = Column("repo_field_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
1505 repo_field_id = Column("repo_field_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
@@ -1537,8 +1535,7 b' class Repository(Base, BaseModel):'
1537 __tablename__ = 'repositories'
1535 __tablename__ = 'repositories'
1538 __table_args__ = (
1536 __table_args__ = (
1539 Index('r_repo_name_idx', 'repo_name', mysql_length=255),
1537 Index('r_repo_name_idx', 'repo_name', mysql_length=255),
1540 {'extend_existing': True, 'mysql_engine': 'InnoDB',
1538 base_table_args,
1541 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
1542 )
1539 )
1543 DEFAULT_CLONE_URI = '{scheme}://{user}@{netloc}/{repo}'
1540 DEFAULT_CLONE_URI = '{scheme}://{user}@{netloc}/{repo}'
1544 DEFAULT_CLONE_URI_ID = '{scheme}://{user}@{netloc}/_{repoid}'
1541 DEFAULT_CLONE_URI_ID = '{scheme}://{user}@{netloc}/_{repoid}'
@@ -2381,8 +2378,7 b' class RepoGroup(Base, BaseModel):'
2381 __table_args__ = (
2378 __table_args__ = (
2382 UniqueConstraint('group_name', 'group_parent_id'),
2379 UniqueConstraint('group_name', 'group_parent_id'),
2383 CheckConstraint('group_id != group_parent_id'),
2380 CheckConstraint('group_id != group_parent_id'),
2384 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2381 base_table_args,
2385 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2386 )
2382 )
2387 __mapper_args__ = {'order_by': 'group_name'}
2383 __mapper_args__ = {'order_by': 'group_name'}
2388
2384
@@ -2664,9 +2660,9 b' class Permission(Base, BaseModel):'
2664 __tablename__ = 'permissions'
2660 __tablename__ = 'permissions'
2665 __table_args__ = (
2661 __table_args__ = (
2666 Index('p_perm_name_idx', 'permission_name'),
2662 Index('p_perm_name_idx', 'permission_name'),
2667 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2663 base_table_args,
2668 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
2669 )
2664 )
2665
2670 PERMS = [
2666 PERMS = [
2671 ('hg.admin', _('RhodeCode Super Administrator')),
2667 ('hg.admin', _('RhodeCode Super Administrator')),
2672
2668
@@ -2889,9 +2885,9 b' class UserRepoToPerm(Base, BaseModel):'
2889 __tablename__ = 'repo_to_perm'
2885 __tablename__ = 'repo_to_perm'
2890 __table_args__ = (
2886 __table_args__ = (
2891 UniqueConstraint('user_id', 'repository_id', 'permission_id'),
2887 UniqueConstraint('user_id', 'repository_id', 'permission_id'),
2892 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2888 base_table_args
2893 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
2894 )
2889 )
2890
2895 repo_to_perm_id = Column("repo_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
2891 repo_to_perm_id = Column("repo_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
2896 user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
2892 user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
2897 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
2893 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
@@ -2918,9 +2914,9 b' class UserUserGroupToPerm(Base, BaseMode'
2918 __tablename__ = 'user_user_group_to_perm'
2914 __tablename__ = 'user_user_group_to_perm'
2919 __table_args__ = (
2915 __table_args__ = (
2920 UniqueConstraint('user_id', 'user_group_id', 'permission_id'),
2916 UniqueConstraint('user_id', 'user_group_id', 'permission_id'),
2921 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2917 base_table_args
2922 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
2923 )
2918 )
2919
2924 user_user_group_to_perm_id = Column("user_user_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
2920 user_user_group_to_perm_id = Column("user_user_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
2925 user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
2921 user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
2926 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
2922 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
@@ -2947,9 +2943,9 b' class UserToPerm(Base, BaseModel):'
2947 __tablename__ = 'user_to_perm'
2943 __tablename__ = 'user_to_perm'
2948 __table_args__ = (
2944 __table_args__ = (
2949 UniqueConstraint('user_id', 'permission_id'),
2945 UniqueConstraint('user_id', 'permission_id'),
2950 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2946 base_table_args
2951 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
2952 )
2947 )
2948
2953 user_to_perm_id = Column("user_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
2949 user_to_perm_id = Column("user_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
2954 user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
2950 user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None, default=None)
2955 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
2951 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
@@ -2965,9 +2961,9 b' class UserGroupRepoToPerm(Base, BaseMode'
2965 __tablename__ = 'users_group_repo_to_perm'
2961 __tablename__ = 'users_group_repo_to_perm'
2966 __table_args__ = (
2962 __table_args__ = (
2967 UniqueConstraint('repository_id', 'users_group_id', 'permission_id'),
2963 UniqueConstraint('repository_id', 'users_group_id', 'permission_id'),
2968 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2964 base_table_args
2969 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
2970 )
2965 )
2966
2971 users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
2967 users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
2972 users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
2968 users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
2973 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
2969 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
@@ -2995,9 +2991,9 b' class UserGroupUserGroupToPerm(Base, Bas'
2995 __table_args__ = (
2991 __table_args__ = (
2996 UniqueConstraint('target_user_group_id', 'user_group_id', 'permission_id'),
2992 UniqueConstraint('target_user_group_id', 'user_group_id', 'permission_id'),
2997 CheckConstraint('target_user_group_id != user_group_id'),
2993 CheckConstraint('target_user_group_id != user_group_id'),
2998 {'extend_existing': True, 'mysql_engine': 'InnoDB',
2994 base_table_args
2999 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
3000 )
2995 )
2996
3001 user_group_user_group_to_perm_id = Column("user_group_user_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
2997 user_group_user_group_to_perm_id = Column("user_group_user_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
3002 target_user_group_id = Column("target_user_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
2998 target_user_group_id = Column("target_user_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
3003 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
2999 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
@@ -3024,9 +3020,9 b' class UserGroupToPerm(Base, BaseModel):'
3024 __tablename__ = 'users_group_to_perm'
3020 __tablename__ = 'users_group_to_perm'
3025 __table_args__ = (
3021 __table_args__ = (
3026 UniqueConstraint('users_group_id', 'permission_id',),
3022 UniqueConstraint('users_group_id', 'permission_id',),
3027 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3023 base_table_args
3028 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
3029 )
3024 )
3025
3030 users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
3026 users_group_to_perm_id = Column("users_group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
3031 users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
3027 users_group_id = Column("users_group_id", Integer(), ForeignKey('users_groups.users_group_id'), nullable=False, unique=None, default=None)
3032 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
3028 permission_id = Column("permission_id", Integer(), ForeignKey('permissions.permission_id'), nullable=False, unique=None, default=None)
@@ -3039,8 +3035,7 b' class UserRepoGroupToPerm(Base, BaseMode'
3039 __tablename__ = 'user_repo_group_to_perm'
3035 __tablename__ = 'user_repo_group_to_perm'
3040 __table_args__ = (
3036 __table_args__ = (
3041 UniqueConstraint('user_id', 'group_id', 'permission_id'),
3037 UniqueConstraint('user_id', 'group_id', 'permission_id'),
3042 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3038 base_table_args
3043 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
3044 )
3039 )
3045
3040
3046 group_to_perm_id = Column("group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
3041 group_to_perm_id = Column("group_to_perm_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
@@ -3066,8 +3061,7 b' class UserGroupRepoGroupToPerm(Base, Bas'
3066 __tablename__ = 'users_group_repo_group_to_perm'
3061 __tablename__ = 'users_group_repo_group_to_perm'
3067 __table_args__ = (
3062 __table_args__ = (
3068 UniqueConstraint('users_group_id', 'group_id'),
3063 UniqueConstraint('users_group_id', 'group_id'),
3069 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3064 base_table_args
3070 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
3071 )
3065 )
3072
3066
3073 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)
3067 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)
@@ -3095,9 +3089,9 b' class UserGroupRepoGroupToPerm(Base, Bas'
3095 class Statistics(Base, BaseModel):
3089 class Statistics(Base, BaseModel):
3096 __tablename__ = 'statistics'
3090 __tablename__ = 'statistics'
3097 __table_args__ = (
3091 __table_args__ = (
3098 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3092 base_table_args
3099 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
3100 )
3093 )
3094
3101 stat_id = Column("stat_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
3095 stat_id = Column("stat_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
3102 repository_id = Column("repository_id", Integer(), ForeignKey('repositories.repo_id'), nullable=False, unique=True, default=None)
3096 repository_id = Column("repository_id", Integer(), ForeignKey('repositories.repo_id'), nullable=False, unique=True, default=None)
3103 stat_on_revision = Column("stat_on_revision", Integer(), nullable=False)
3097 stat_on_revision = Column("stat_on_revision", Integer(), nullable=False)
@@ -3113,8 +3107,7 b' class UserFollowing(Base, BaseModel):'
3113 __table_args__ = (
3107 __table_args__ = (
3114 UniqueConstraint('user_id', 'follows_repository_id'),
3108 UniqueConstraint('user_id', 'follows_repository_id'),
3115 UniqueConstraint('user_id', 'follows_user_id'),
3109 UniqueConstraint('user_id', 'follows_user_id'),
3116 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3110 base_table_args
3117 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
3118 )
3111 )
3119
3112
3120 user_following_id = Column("user_following_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
3113 user_following_id = Column("user_following_id", Integer(), nullable=False, unique=True, default=None, primary_key=True)
@@ -3138,9 +3131,9 b' class CacheKey(Base, BaseModel):'
3138 __table_args__ = (
3131 __table_args__ = (
3139 UniqueConstraint('cache_key'),
3132 UniqueConstraint('cache_key'),
3140 Index('key_idx', 'cache_key'),
3133 Index('key_idx', 'cache_key'),
3141 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3134 base_table_args,
3142 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
3143 )
3135 )
3136
3144 CACHE_TYPE_ATOM = 'ATOM'
3137 CACHE_TYPE_ATOM = 'ATOM'
3145 CACHE_TYPE_RSS = 'RSS'
3138 CACHE_TYPE_RSS = 'RSS'
3146 CACHE_TYPE_README = 'README'
3139 CACHE_TYPE_README = 'README'
@@ -3265,8 +3258,7 b' class ChangesetComment(Base, BaseModel):'
3265 __tablename__ = 'changeset_comments'
3258 __tablename__ = 'changeset_comments'
3266 __table_args__ = (
3259 __table_args__ = (
3267 Index('cc_revision_idx', 'revision'),
3260 Index('cc_revision_idx', 'revision'),
3268 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3261 base_table_args,
3269 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
3270 )
3262 )
3271
3263
3272 COMMENT_OUTDATED = u'comment_outdated'
3264 COMMENT_OUTDATED = u'comment_outdated'
@@ -3390,9 +3382,9 b' class ChangesetStatus(Base, BaseModel):'
3390 Index('cs_revision_idx', 'revision'),
3382 Index('cs_revision_idx', 'revision'),
3391 Index('cs_version_idx', 'version'),
3383 Index('cs_version_idx', 'version'),
3392 UniqueConstraint('repo_id', 'revision', 'version'),
3384 UniqueConstraint('repo_id', 'revision', 'version'),
3393 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3385 base_table_args
3394 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
3395 )
3386 )
3387
3396 STATUS_NOT_REVIEWED = DEFAULT = 'not_reviewed'
3388 STATUS_NOT_REVIEWED = DEFAULT = 'not_reviewed'
3397 STATUS_APPROVED = 'approved'
3389 STATUS_APPROVED = 'approved'
3398 STATUS_REJECTED = 'rejected'
3390 STATUS_REJECTED = 'rejected'
@@ -3662,8 +3654,7 b' class _PullRequestBase(BaseModel):'
3662 class PullRequest(Base, _PullRequestBase):
3654 class PullRequest(Base, _PullRequestBase):
3663 __tablename__ = 'pull_requests'
3655 __tablename__ = 'pull_requests'
3664 __table_args__ = (
3656 __table_args__ = (
3665 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3657 base_table_args,
3666 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
3667 )
3658 )
3668
3659
3669 pull_request_id = Column(
3660 pull_request_id = Column(
@@ -3781,8 +3772,7 b' class PullRequest(Base, _PullRequestBase'
3781 class PullRequestVersion(Base, _PullRequestBase):
3772 class PullRequestVersion(Base, _PullRequestBase):
3782 __tablename__ = 'pull_request_versions'
3773 __tablename__ = 'pull_request_versions'
3783 __table_args__ = (
3774 __table_args__ = (
3784 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3775 base_table_args,
3785 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
3786 )
3776 )
3787
3777
3788 pull_request_version_id = Column(
3778 pull_request_version_id = Column(
@@ -3820,8 +3810,7 b' class PullRequestVersion(Base, _PullRequ'
3820 class PullRequestReviewers(Base, BaseModel):
3810 class PullRequestReviewers(Base, BaseModel):
3821 __tablename__ = 'pull_request_reviewers'
3811 __tablename__ = 'pull_request_reviewers'
3822 __table_args__ = (
3812 __table_args__ = (
3823 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3813 base_table_args,
3824 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
3825 )
3814 )
3826
3815
3827 @hybrid_property
3816 @hybrid_property
@@ -3881,8 +3870,7 b' class Notification(Base, BaseModel):'
3881 __tablename__ = 'notifications'
3870 __tablename__ = 'notifications'
3882 __table_args__ = (
3871 __table_args__ = (
3883 Index('notification_type_idx', 'type'),
3872 Index('notification_type_idx', 'type'),
3884 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3873 base_table_args,
3885 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
3886 )
3874 )
3887
3875
3888 TYPE_CHANGESET_COMMENT = u'cs_comment'
3876 TYPE_CHANGESET_COMMENT = u'cs_comment'
@@ -3940,9 +3928,9 b' class UserNotification(Base, BaseModel):'
3940 __tablename__ = 'user_to_notification'
3928 __tablename__ = 'user_to_notification'
3941 __table_args__ = (
3929 __table_args__ = (
3942 UniqueConstraint('user_id', 'notification_id'),
3930 UniqueConstraint('user_id', 'notification_id'),
3943 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3931 base_table_args
3944 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
3945 )
3932 )
3933
3946 user_id = Column('user_id', Integer(), ForeignKey('users.user_id'), primary_key=True)
3934 user_id = Column('user_id', Integer(), ForeignKey('users.user_id'), primary_key=True)
3947 notification_id = Column("notification_id", Integer(), ForeignKey('notifications.notification_id'), primary_key=True)
3935 notification_id = Column("notification_id", Integer(), ForeignKey('notifications.notification_id'), primary_key=True)
3948 read = Column('read', Boolean, default=False)
3936 read = Column('read', Boolean, default=False)
@@ -3962,9 +3950,9 b' class Gist(Base, BaseModel):'
3962 __table_args__ = (
3950 __table_args__ = (
3963 Index('g_gist_access_id_idx', 'gist_access_id'),
3951 Index('g_gist_access_id_idx', 'gist_access_id'),
3964 Index('g_created_on_idx', 'created_on'),
3952 Index('g_created_on_idx', 'created_on'),
3965 {'extend_existing': True, 'mysql_engine': 'InnoDB',
3953 base_table_args
3966 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
3967 )
3954 )
3955
3968 GIST_PUBLIC = u'public'
3956 GIST_PUBLIC = u'public'
3969 GIST_PRIVATE = u'private'
3957 GIST_PRIVATE = u'private'
3970 DEFAULT_FILENAME = u'gistfile1.txt'
3958 DEFAULT_FILENAME = u'gistfile1.txt'
@@ -4059,8 +4047,8 b' class ExternalIdentity(Base, BaseModel):'
4059 __table_args__ = (
4047 __table_args__ = (
4060 Index('local_user_id_idx', 'local_user_id'),
4048 Index('local_user_id_idx', 'local_user_id'),
4061 Index('external_id_idx', 'external_id'),
4049 Index('external_id_idx', 'external_id'),
4062 {'extend_existing': True, 'mysql_engine': 'InnoDB',
4050 base_table_args
4063 'mysql_charset': 'utf8'})
4051 )
4064
4052
4065 external_id = Column('external_id', Unicode(255), default=u'',
4053 external_id = Column('external_id', Unicode(255), default=u'',
4066 primary_key=True)
4054 primary_key=True)
@@ -4121,8 +4109,7 b' class ExternalIdentity(Base, BaseModel):'
4121 class Integration(Base, BaseModel):
4109 class Integration(Base, BaseModel):
4122 __tablename__ = 'integrations'
4110 __tablename__ = 'integrations'
4123 __table_args__ = (
4111 __table_args__ = (
4124 {'extend_existing': True, 'mysql_engine': 'InnoDB',
4112 base_table_args
4125 'mysql_charset': 'utf8', 'sqlite_autoincrement': True}
4126 )
4113 )
4127
4114
4128 integration_id = Column('integration_id', Integer(), primary_key=True)
4115 integration_id = Column('integration_id', Integer(), primary_key=True)
@@ -4165,8 +4152,7 b' class Integration(Base, BaseModel):'
4165 class RepoReviewRuleUser(Base, BaseModel):
4152 class RepoReviewRuleUser(Base, BaseModel):
4166 __tablename__ = 'repo_review_rules_users'
4153 __tablename__ = 'repo_review_rules_users'
4167 __table_args__ = (
4154 __table_args__ = (
4168 {'extend_existing': True, 'mysql_engine': 'InnoDB',
4155 base_table_args
4169 'mysql_charset': 'utf8', 'sqlite_autoincrement': True,}
4170 )
4156 )
4171
4157
4172 repo_review_rule_user_id = Column('repo_review_rule_user_id', Integer(), primary_key=True)
4158 repo_review_rule_user_id = Column('repo_review_rule_user_id', Integer(), primary_key=True)
@@ -4184,9 +4170,9 b' class RepoReviewRuleUser(Base, BaseModel'
4184 class RepoReviewRuleUserGroup(Base, BaseModel):
4170 class RepoReviewRuleUserGroup(Base, BaseModel):
4185 __tablename__ = 'repo_review_rules_users_groups'
4171 __tablename__ = 'repo_review_rules_users_groups'
4186 __table_args__ = (
4172 __table_args__ = (
4187 {'extend_existing': True, 'mysql_engine': 'InnoDB',
4173 base_table_args
4188 'mysql_charset': 'utf8', 'sqlite_autoincrement': True,}
4189 )
4174 )
4175
4190 VOTE_RULE_ALL = -1
4176 VOTE_RULE_ALL = -1
4191
4177
4192 repo_review_rule_users_group_id = Column('repo_review_rule_users_group_id', Integer(), primary_key=True)
4178 repo_review_rule_users_group_id = Column('repo_review_rule_users_group_id', Integer(), primary_key=True)
@@ -4213,8 +4199,7 b' class RepoReviewRuleUserGroup(Base, Base'
4213 class RepoReviewRule(Base, BaseModel):
4199 class RepoReviewRule(Base, BaseModel):
4214 __tablename__ = 'repo_review_rules'
4200 __tablename__ = 'repo_review_rules'
4215 __table_args__ = (
4201 __table_args__ = (
4216 {'extend_existing': True, 'mysql_engine': 'InnoDB',
4202 base_table_args
4217 'mysql_charset': 'utf8', 'sqlite_autoincrement': True,}
4218 )
4203 )
4219
4204
4220 repo_review_rule_id = Column(
4205 repo_review_rule_id = Column(
@@ -4364,9 +4349,9 b' class ScheduleEntry(Base, BaseModel):'
4364 __table_args__ = (
4349 __table_args__ = (
4365 UniqueConstraint('schedule_name', name='s_schedule_name_idx'),
4350 UniqueConstraint('schedule_name', name='s_schedule_name_idx'),
4366 UniqueConstraint('task_uid', name='s_task_uid_idx'),
4351 UniqueConstraint('task_uid', name='s_task_uid_idx'),
4367 {'extend_existing': True, 'mysql_engine': 'InnoDB',
4352 base_table_args,
4368 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
4369 )
4353 )
4354
4370 schedule_types = ['crontab', 'timedelta', 'integer']
4355 schedule_types = ['crontab', 'timedelta', 'integer']
4371 schedule_entry_id = Column('schedule_entry_id', Integer(), primary_key=True)
4356 schedule_entry_id = Column('schedule_entry_id', Integer(), primary_key=True)
4372
4357
@@ -4492,9 +4477,9 b' def set_task_uid(mapper, connection, tar'
4492 class DbMigrateVersion(Base, BaseModel):
4477 class DbMigrateVersion(Base, BaseModel):
4493 __tablename__ = 'db_migrate_version'
4478 __tablename__ = 'db_migrate_version'
4494 __table_args__ = (
4479 __table_args__ = (
4495 {'extend_existing': True, 'mysql_engine': 'InnoDB',
4480 base_table_args,
4496 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
4497 )
4481 )
4482
4498 repository_id = Column('repository_id', String(250), primary_key=True)
4483 repository_id = Column('repository_id', String(250), primary_key=True)
4499 repository_path = Column('repository_path', Text)
4484 repository_path = Column('repository_path', Text)
4500 version = Column('version', Integer)
4485 version = Column('version', Integer)
@@ -4503,8 +4488,7 b' class DbMigrateVersion(Base, BaseModel):'
4503 class DbSession(Base, BaseModel):
4488 class DbSession(Base, BaseModel):
4504 __tablename__ = 'db_session'
4489 __tablename__ = 'db_session'
4505 __table_args__ = (
4490 __table_args__ = (
4506 {'extend_existing': True, 'mysql_engine': 'InnoDB',
4491 base_table_args,
4507 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
4508 )
4492 )
4509
4493
4510 def __repr__(self):
4494 def __repr__(self):
@@ -4517,12 +4501,10 b' class DbSession(Base, BaseModel):'
4517 data = Column('data', PickleType, nullable=False)
4501 data = Column('data', PickleType, nullable=False)
4518
4502
4519
4503
4520
4521 class BeakerCache(Base, BaseModel):
4504 class BeakerCache(Base, BaseModel):
4522 __tablename__ = 'beaker_cache'
4505 __tablename__ = 'beaker_cache'
4523 __table_args__ = (
4506 __table_args__ = (
4524 {'extend_existing': True, 'mysql_engine': 'InnoDB',
4507 base_table_args,
4525 'mysql_charset': 'utf8', 'sqlite_autoincrement': True},
4526 )
4508 )
4527
4509
4528 def __repr__(self):
4510 def __repr__(self):
General Comments 0
You need to be logged in to leave comments. Login now