##// END OF EJS Templates
database: fix migration for mysql....
marcink -
r3791:427b1696 stable
parent child Browse files
Show More
@@ -1,35 +1,36 b''
1 1 # -*- coding: utf-8 -*-
2 2
3 3 import logging
4 4
5 5 from alembic.migration import MigrationContext
6 6 from alembic.operations import Operations
7 from sqlalchemy import String
7 8
8 9 from rhodecode.lib.dbmigrate.versions import _reset_base
9 10 from rhodecode.model import init_model_encryption
10 11
11 12
12 13 log = logging.getLogger(__name__)
13 14
14 15
15 16 def upgrade(migrate_engine):
16 17 """
17 18 Upgrade operations go here.
18 19 Don't create your own engine; bind migrate_engine to your metadata
19 20 """
20 21 _reset_base(migrate_engine)
21 22 from rhodecode.lib.dbmigrate.schema import db_4_16_0_2
22 23
23 24 init_model_encryption(db_4_16_0_2)
24 25
25 26 context = MigrationContext.configure(migrate_engine.connect())
26 27 op = Operations(context)
27 28
28 29 repo_group = db_4_16_0_2.RepoGroup.__table__
29 30
30 31 with op.batch_alter_table(repo_group.name) as batch_op:
31 batch_op.alter_column("repo_group_name_hash", nullable=False)
32 batch_op.alter_column("repo_group_name_hash", type_=String(1024), nullable=False)
32 33
33 34
34 35 def downgrade(migrate_engine):
35 36 pass
General Comments 0
You need to be logged in to leave comments. Login now