210693f3123d_create_cdr_table.py

Go to the documentation of this file.
00001 #
00002 # Asterisk -- An open source telephony toolkit.
00003 #
00004 # Copyright (C) 2014, Richard Mudgett
00005 #
00006 # Richard Mudgett <rmudgett@digium.com>
00007 #
00008 # See http://www.asterisk.org for more information about
00009 # the Asterisk project. Please do not directly contact
00010 # any of the maintainers of this project for assistance;
00011 # the project provides a web site, mailing lists and IRC
00012 # channels for your use.
00013 #
00014 # This program is free software, distributed under the terms of
00015 # the GNU General Public License Version 2. See the LICENSE file
00016 # at the top of the source tree.
00017 #
00018 
00019 """Create CDR table.
00020 
00021 Revision ID: 210693f3123d
00022 Revises: None
00023 Create Date: 2014-02-14 15:11:43.867292
00024 
00025 """
00026 
00027 # revision identifiers, used by Alembic.
00028 revision = '210693f3123d'
00029 down_revision = None
00030 
00031 from alembic import op
00032 import sqlalchemy as sa
00033 
00034 
00035 def upgrade():
00036     op.create_table(
00037         'cdr',
00038         sa.Column('accountcode', sa.String(20)),
00039         sa.Column('src', sa.String(80)),
00040         sa.Column('dst', sa.String(80)),
00041         sa.Column('dcontext', sa.String(80)),
00042         sa.Column('clid', sa.String(80)),
00043         sa.Column('channel', sa.String(80)),
00044         sa.Column('dstchannel', sa.String(80)),
00045         sa.Column('lastapp', sa.String(80)),
00046         sa.Column('lastdata', sa.String(80)),
00047         sa.Column('start', sa.DateTime()),
00048         sa.Column('answer', sa.DateTime()),
00049         sa.Column('end', sa.DateTime()),
00050         sa.Column('duration', sa.Integer),
00051         sa.Column('billsec', sa.Integer),
00052         sa.Column('disposition', sa.String(45)),
00053         sa.Column('amaflags', sa.String(45)),
00054         sa.Column('userfield', sa.String(256)),
00055         sa.Column('uniqueid', sa.String(150)),
00056         sa.Column('linkedid', sa.String(150)),
00057         sa.Column('peeraccount', sa.String(20)),
00058         sa.Column('sequence', sa.Integer)
00059     )
00060 
00061 
00062 def downgrade():
00063     op.drop_table('cdr')
00064 

Generated on Thu Apr 16 06:27:05 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6