~singpolyma/asterisk

ref: upstream/16.2.1_dfsg asterisk/contrib/ast-db-manage/config/versions/339a3bdf53fc_expand_accountcode_to_80.py -rw-r--r-- 1.0 KiB
fe6d69c0Stephen Paul Weber import-tar 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""expand accountcode to 80

Revision ID: 339a3bdf53fc
Revises: 28ce1e718f05
Create Date: 2015-11-05 10:10:27.465794

"""

# revision identifiers, used by Alembic.
revision = '339a3bdf53fc'
down_revision = '28ce1e718f05'

from alembic import op
import sqlalchemy as sa


def upgrade():
    with op.batch_alter_table('ps_endpoints') as batch_op:
        batch_op.alter_column('accountcode', type_=sa.String(80))
    with op.batch_alter_table('sippeers') as batch_op:
        batch_op.alter_column('accountcode', type_=sa.String(80))
    with op.batch_alter_table('iaxfriends') as batch_op:
        batch_op.alter_column('accountcode', type_=sa.String(80))
    pass


def downgrade():
    with op.batch_alter_table('ps_endpoints') as batch_op:
        batch_op.alter_column('accountcode', type_=sa.String(20))
    with op.batch_alter_table('sippeers') as batch_op:
        batch_op.alter_column('accountcode', type_=sa.String(40))
    with op.batch_alter_table('iaxfriends') as batch_op:
        batch_op.alter_column('accountcode', type_=sa.String(20))
    pass