##// END OF EJS Templates
diffs: use whole chunk diff to calculate if it's oversized or not....
diffs: use whole chunk diff to calculate if it's oversized or not. - This fixes an issue if a file is added that has very large number of small lines. In this case the time to detect if the diff should be limited was very very long and CPU intensive.

File last commit:

r1:854a839a default
r2070:7939c6bf default
Show More
049_version_4_0_0.py
49 lines | 1.5 KiB | text/x-python | PythonLexer
project: added all source files and assets
r1 # -*- coding: utf-8 -*-
import logging
import sqlalchemy as sa
from alembic.migration import MigrationContext
from alembic.operations import Operations
from rhodecode.lib.dbmigrate.versions import _reset_base
from rhodecode.model import init_model_encryption
log = logging.getLogger(__name__)
def upgrade(migrate_engine):
"""
Upgrade operations go here.
Don't create your own engine; bind migrate_engine to your metadata
"""
_reset_base(migrate_engine)
from rhodecode.lib.dbmigrate.schema import db_3_7_0_0
init_model_encryption(db_3_7_0_0)
context = MigrationContext.configure(migrate_engine.connect())
op = Operations(context)
op.create_table(
'external_identities',
sa.Column('provider_name', sa.Unicode(255), primary_key=True),
sa.Column('local_user_id', sa.Integer(),
sa.ForeignKey('users.user_id'), primary_key=True),
sa.Column('external_id', sa.Unicode(255), primary_key=True),
sa.Column('external_username', sa.Unicode(1024), default=u''),
sa.Column('access_token', sa.String(1024), default=u''),
sa.Column('alt_token', sa.String(1024), default=u''),
sa.Column('token_secret', sa.String(1024), default=u'')
)
op.create_index('local_user_id_idx', 'external_identities',
['local_user_id'])
op.create_index('external_id_idx', 'external_identities',
['external_id'])
def downgrade(migrate_engine):
pass