Asterisk - The Open Source Telephony Project GIT-master-abe0018
581a4264e537_adding_extensions.py
Go to the documentation of this file.
2# Asterisk -- An open source telephony toolkit.
3#
4# Copyright (C) 2013, Digium, Inc.
5#
6# Scott Griepentrog <sgriepentrog@digium.com>
7#
8# See http://www.asterisk.org for more information about
9# the Asterisk project. Please do not directly contact
10# any of the maintainers of this project for assistance;
11# the project provides a web site, mailing lists and IRC
12# channels for your use.
13#
14# This program is free software, distributed under the terms of
15# the GNU General Public License Version 2. See the LICENSE file
16# at the top of the source tree.
17#
18
19"""adding extensions
20
21Revision ID: 581a4264e537
22Revises: 43956d550a44
23Create Date: 2013-12-10 16:32:41.145327
24
25"""
26
27# revision identifiers, used by Alembic.
28revision = '581a4264e537'
29down_revision = '43956d550a44'
30
31from alembic import op
32import sqlalchemy as sa
33
34def upgrade():
35 op.create_table(
36 'extensions',
37 sa.Column('id', sa.BigInteger, primary_key=True, nullable=False,
38 unique=True, autoincrement=True),
39 sa.Column('context', sa.String(40), nullable=False),
40 sa.Column('exten', sa.String(40), nullable=False),
41 sa.Column('priority', sa.Integer, nullable=False),
42 sa.Column('app', sa.String(40), nullable=False),
43 sa.Column('appdata', sa.String(256), nullable=False),
44 sa.UniqueConstraint('context', 'exten', 'priority')
45 )
46
48 op.drop_table('extensions')