Asterisk - The Open Source Telephony Project  18.5.0
581a4264e537_adding_extensions.py
Go to the documentation of this file.
1 #
2 # Asterisk -- An open source telephony toolkit.
3 #
4 # Copyright (C) 2013, Digium, Inc.
5 #
6 # Scott Griepentrog <[email protected]>
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 
21 Revision ID: 581a4264e537
22 Revises: 43956d550a44
23 Create Date: 2013-12-10 16:32:41.145327
24 
25 """
26 
27 # revision identifiers, used by Alembic.
28 revision = '581a4264e537'
29 down_revision = '43956d550a44'
30 
31 from alembic import op
32 import sqlalchemy as sa
33 
34 def 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 
47 def downgrade():
48  op.drop_table('extensions')