581a4264e537_adding_extensions.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #
  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. """adding extensions
  19. Revision ID: 581a4264e537
  20. Revises: 43956d550a44
  21. Create Date: 2013-12-10 16:32:41.145327
  22. """
  23. # revision identifiers, used by Alembic.
  24. revision = '581a4264e537'
  25. down_revision = '43956d550a44'
  26. from alembic import op
  27. import sqlalchemy as sa
  28. def upgrade():
  29. op.create_table(
  30. 'extensions',
  31. sa.Column('id', sa.BigInteger, primary_key=True, nullable=False,
  32. unique=True, autoincrement=True),
  33. sa.Column('context', sa.String(40), nullable=False),
  34. sa.Column('exten', sa.String(40), nullable=False),
  35. sa.Column('priority', sa.Integer, nullable=False),
  36. sa.Column('app', sa.String(40), nullable=False),
  37. sa.Column('appdata', sa.String(256), nullable=False),
  38. sa.UniqueConstraint('context', 'exten', 'priority')
  39. )
  40. def downgrade():
  41. op.drop_table('extensions')