~singpolyma/asterisk

ref: 130ba7aeba07eb8bb3ea34418ca458bb58b05080 asterisk/contrib/ast-db-manage/config/versions/339a3bdf53fc_expand_accountcode_to_80.py -rw-r--r-- 1.0 KiB
130ba7ae — Bernhard Schmidt Import asterisk_16.2.1~dfsg.orig.tar.xz 3 years 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