alembic: Fix downgrade and tweak for sqlite
[asterisk/asterisk.git] / contrib / ast-db-manage / config / versions / 461d7d691209_add_pjsip_qualify_timeout.py
1 """add pjsip qualify_timeout
2
3 Revision ID: 461d7d691209
4 Revises: 31cd4f4891ec
5 Create Date: 2015-04-15 13:54:08.047851
6
7 """
8
9 # revision identifiers, used by Alembic.
10 revision = '461d7d691209'
11 down_revision = '31cd4f4891ec'
12
13 from alembic import op
14 import sqlalchemy as sa
15
16 def upgrade():
17     op.add_column('ps_aors', sa.Column('qualify_timeout', sa.Integer))
18     op.add_column('ps_contacts', sa.Column('qualify_timeout', sa.Integer))
19
20 def downgrade():
21     with op.batch_alter_table('ps_aors') as batch_op:
22         batch_op.drop_column('qualify_timeout')
23     with op.batch_alter_table('ps_contacts') as batch_op:
24         batch_op.drop_column('qualify_timeout')