Asterisk - The Open Source Telephony Project GIT-master-f36a736
a2e9769475e_create_tables.py
Go to the documentation of this file.
2# Asterisk -- An open source telephony toolkit.
3#
4# Copyright (C) 2013, Russell Bryant
5#
6# Russell Bryant <russell@russellbryant.net>
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"""Create tables
20
21Revision ID: a2e9769475e
22Revises: None
23Create Date: 2013-07-29 23:43:09.431668
24
25"""
26
27# revision identifiers, used by Alembic.
28revision = 'a2e9769475e'
29down_revision = None
30
31from alembic import op
32import sqlalchemy as sa
33
34
35def upgrade():
36 op.create_table(
37 'voicemail_messages',
38 sa.Column('dir', sa.String(255), nullable=False),
39 sa.Column('msgnum', sa.Integer, nullable=False),
40 sa.Column('context', sa.String(80)),
41 sa.Column('macrocontext', sa.String(80)),
42 sa.Column('callerid', sa.String(80)),
43 sa.Column('origtime', sa.Integer),
44 sa.Column('duration', sa.Integer),
45 sa.Column('recording', sa.LargeBinary),
46 sa.Column('flag', sa.String(30)),
47 sa.Column('category', sa.String(30)),
48 sa.Column('mailboxuser', sa.String(30)),
49 sa.Column('mailboxcontext', sa.String(30)),
50 sa.Column('msg_id', sa.String(40))
51 )
52 op.create_primary_key('voicemail_messages_dir_msgnum',
53 'voicemail_messages', ['dir', 'msgnum'])
54 op.create_index('voicemail_messages_dir', 'voicemail_messages', ['dir'])
55
56
58 op.drop_table('voicemail_messages')