f25c2987e6f34aa757d2844db2390f20979e318b
[asterisk/asterisk.git] / contrib / ast-db-manage / config / versions / e96a0b8071c_increase_pjsip_column_size.py
1 """increase pjsip columns size
2
3 Revision ID: e96a0b8071c
4 Revises: 3855ee4e5f85
5 Create Date: 2014-04-23 11:38:02.333786
6
7 """
8
9 # revision identifiers, used by Alembic.
10 revision = 'e96a0b8071c'
11 down_revision = '3855ee4e5f85'
12
13 from alembic import op
14 import sqlalchemy as sa
15
16
17 def upgrade():
18     with op.batch_alter_table('ps_globals') as batch_op:
19         batch_op.alter_column('user_agent', type_=sa.String(255))
20
21     with op.batch_alter_table('ps_contacts') as batch_op:
22         batch_op.alter_column('id', type_=sa.String(255))
23         batch_op.alter_column('uri', type_=sa.String(255))
24         batch_op.alter_column('user_agent', type_=sa.String(255))
25
26     with op.batch_alter_table('ps_registrations') as batch_op:
27         batch_op.alter_column('client_uri', type_=sa.String(255))
28         batch_op.alter_column('server_uri', type_=sa.String(255))
29
30
31 def downgrade():
32     with op.batch_alter_table('ps_globals') as batch_op:
33         batch_op.alter_column('user_agent', type_=sa.String(40))
34
35     with op.batch_alter_table('ps_contacts') as batch_op:
36         batch_op.alter_column('id', type_=sa.String(40))
37         batch_op.alter_column('uri', type_=sa.String(40))
38         batch_op.alter_column('user_agent', type_=sa.String(40))
39
40     with op.batch_alter_table('ps_registrations') as batch_op:
41         batch_op.alter_column('client_uri', type_=sa.String(40))
42         batch_op.alter_column('server_uri', type_=sa.String(40))