3Revision ID: 2da192dbbc65
5Create Date: 2017-04-05 10:16:52.504699
10revision =
'2da192dbbc65'
11down_revision =
'8fce4c573e15'
14import sqlalchemy
as sa
15from sqlalchemy.dialects.postgresql
import ENUM
17YESNO_NAME =
'yesno_values'
18YESNO_VALUES = [
'yes',
'no']
25 yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=
False)
28 'ps_outbound_publishes',
29 sa.Column(
'id', sa.String(40), nullable=
False, unique=
True),
30 sa.Column(
'expiration', sa.Integer),
31 sa.Column(
'outbound_auth', sa.String(40)),
32 sa.Column(
'outbound_proxy', sa.String(256)),
33 sa.Column(
'server_uri', sa.String(256)),
34 sa.Column(
'from_uri', sa.String(256)),
35 sa.Column(
'to_uri', sa.String(256)),
36 sa.Column(
'event', sa.String(40)),
37 sa.Column(
'max_auth_attempts', sa.Integer),
38 sa.Column(
'transport', sa.String(40)),
39 sa.Column(
'multi_user', yesno_values),
40 sa.Column(
'@body', sa.String(40)),
41 sa.Column(
'@context', sa.String(256)),
42 sa.Column(
'@exten', sa.String(256)),
45 op.create_index(
'ps_outbound_publishes_id',
'ps_outbound_publishes', [
'id'])
48 'ps_inbound_publications',
49 sa.Column(
'id', sa.String(40), nullable=
False, unique=
True),
50 sa.Column(
'endpoint', sa.String(40)),
51 sa.Column(
'event_asterisk-devicestate', sa.String(40)),
52 sa.Column(
'event_asterisk-mwi', sa.String(40)),
55 op.create_index(
'ps_inbound_publications_id',
'ps_inbound_publications', [
'id'])
58 'ps_asterisk_publications',
59 sa.Column(
'id', sa.String(40), nullable=
False, unique=
True),
60 sa.Column(
'devicestate_publish', sa.String(40)),
61 sa.Column(
'mailboxstate_publish', sa.String(40)),
62 sa.Column(
'device_state', yesno_values),
63 sa.Column(
'device_state_filter', sa.String(256)),
64 sa.Column(
'mailbox_state', yesno_values),
65 sa.Column(
'mailbox_state_filter', sa.String(256)),
68 op.create_index(
'ps_asterisk_publications_id',
'ps_asterisk_publications', [
'id'])
71 op.drop_table(
'ps_outbound_publishes')
72 op.drop_table(
'ps_inbound_publications')
73 op.drop_table(
'ps_asterisk_publications')