Asterisk - The Open Source Telephony Project GIT-master-57e2743
Loading...
Searching...
No Matches
Functions | Variables
2b45fd748a4f_add_geolocation_tables Namespace Reference

Functions

 downgrade ()
 
 upgrade ()
 

Variables

str AST_BOOL_NAME = 'ast_bool_values'
 
list AST_BOOL_VALUES
 
str down_revision = '2285f2ace275'
 
str GEOLOC_LOCATION_FORMAT_NAME = 'geoloc_location_format_values'
 
list GEOLOC_LOCATION_FORMAT_VALUES = ['<none>','civicAddress','GML','URI']
 
str GEOLOC_PROFILE_PIDF_ELEMENT_NAME = 'geoloc_profile_pidf_element_values'
 
list GEOLOC_PROFILE_PIDF_ELEMENT_VALUES = ['<none>','tuple', 'device', 'person']
 
str GEOLOC_PROFILE_PRECEDENCE_NAME = 'geoloc_profile_precedence_values'
 
list GEOLOC_PROFILE_PRECEDENCE_VALUES = ['prefer_incoming', 'prefer_config', 'discard_incoming','discard_config']
 
str revision = '2b45fd748a4f'
 

Function Documentation

◆ downgrade()

downgrade ( )

Definition at line 74 of file 2b45fd748a4f_add_geolocation_tables.py.

74def downgrade():
75 op.drop_table('geoloc_location')
76 op.drop_table('geoloc_profile')
77 sa.Enum(*GEOLOC_LOCATION_FORMAT_VALUES, name=GEOLOC_LOCATION_FORMAT_NAME).drop(op.get_bind(), checkfirst=True)
78 sa.Enum(*GEOLOC_PROFILE_PIDF_ELEMENT_VALUES, name=GEOLOC_PROFILE_PIDF_ELEMENT_NAME).drop(op.get_bind(), checkfirst=True)
79 sa.Enum(*GEOLOC_PROFILE_PRECEDENCE_VALUES, name=GEOLOC_PROFILE_PRECEDENCE_NAME).drop(op.get_bind(), checkfirst=True)

◆ upgrade()

upgrade ( )

Definition at line 32 of file 2b45fd748a4f_add_geolocation_tables.py.

32def upgrade():
33 enum_format = sa.Enum(*GEOLOC_LOCATION_FORMAT_VALUES, name=GEOLOC_LOCATION_FORMAT_NAME)
34 enum_pidf_element = sa.Enum(*GEOLOC_PROFILE_PIDF_ELEMENT_VALUES, name=GEOLOC_PROFILE_PIDF_ELEMENT_NAME)
35 enum_precedence = sa.Enum(*GEOLOC_PROFILE_PRECEDENCE_VALUES, name=GEOLOC_PROFILE_PRECEDENCE_NAME)
36 ast_bool_values = ENUM(*AST_BOOL_VALUES, name=AST_BOOL_NAME, create_type=False)
37
38#
39# The use of the 'TEXT' column type instead of 'String' for the string data columns
40# is deliberate. Many of the columns can be very long (>= 2048) and if defined as
41# 'String(n)' would add up to more than the maximum row size (65535) for MySql.
42#
43 op.create_table(
44 'geoloc_location',
45 sa.Column('id', sa.String(80), nullable=False, primary_key=True),
46 sa.Column('format', enum_format, nullable=True),
47 sa.Column('location_info', sa.TEXT, nullable=True),
48 sa.Column('location_source', sa.TEXT, nullable=True),
49 sa.Column('confidence', sa.TEXT, nullable=True),
50 sa.Column('method', sa.TEXT, nullable=True)
51 )
52
53 op.create_table(
54 'geoloc_profile',
55 sa.Column('id', sa.String(80), nullable=False, primary_key=True),
56 sa.Column('pidf_element', enum_pidf_element, nullable=True),
57 sa.Column('pidf_element_id', sa.TEXT, nullable=True),
58 sa.Column('device_id', sa.TEXT, nullable=True),
59 sa.Column('location_reference', sa.TEXT, nullable=True),
60 sa.Column('location_info_refinement', sa.TEXT, nullable=True),
61 sa.Column('location_variables', sa.TEXT, nullable=True),
62 sa.Column('usage_rules', sa.TEXT, nullable=True),
63 sa.Column('notes', sa.TEXT, nullable=True),
64 sa.Column('allow_routing_use', ast_bool_values),
65 sa.Column('suppress_empty_ca_elements', ast_bool_values),
66 sa.Column('profile_precedence', enum_precedence, nullable=True),
67 sa.Column('format', enum_format, nullable=True),
68 sa.Column('location_info', sa.TEXT, nullable=True),
69 sa.Column('location_source', sa.TEXT, nullable=True),
70 sa.Column('confidence', sa.TEXT, nullable=True),
71 sa.Column('method', sa.TEXT, nullable=True)
72 )
73

Variable Documentation

◆ AST_BOOL_NAME

str AST_BOOL_NAME = 'ast_bool_values'

Definition at line 17 of file 2b45fd748a4f_add_geolocation_tables.py.

◆ AST_BOOL_VALUES

list AST_BOOL_VALUES
Initial value:
1= [ '0', '1',
2 'off', 'on',
3 'false', 'true',
4 'no', 'yes' ]

Definition at line 18 of file 2b45fd748a4f_add_geolocation_tables.py.

◆ down_revision

str down_revision = '2285f2ace275'

Definition at line 11 of file 2b45fd748a4f_add_geolocation_tables.py.

◆ GEOLOC_LOCATION_FORMAT_NAME

str GEOLOC_LOCATION_FORMAT_NAME = 'geoloc_location_format_values'

Definition at line 23 of file 2b45fd748a4f_add_geolocation_tables.py.

◆ GEOLOC_LOCATION_FORMAT_VALUES

list GEOLOC_LOCATION_FORMAT_VALUES = ['<none>','civicAddress','GML','URI']

Definition at line 24 of file 2b45fd748a4f_add_geolocation_tables.py.

◆ GEOLOC_PROFILE_PIDF_ELEMENT_NAME

str GEOLOC_PROFILE_PIDF_ELEMENT_NAME = 'geoloc_profile_pidf_element_values'

Definition at line 26 of file 2b45fd748a4f_add_geolocation_tables.py.

◆ GEOLOC_PROFILE_PIDF_ELEMENT_VALUES

list GEOLOC_PROFILE_PIDF_ELEMENT_VALUES = ['<none>','tuple', 'device', 'person']

Definition at line 27 of file 2b45fd748a4f_add_geolocation_tables.py.

◆ GEOLOC_PROFILE_PRECEDENCE_NAME

str GEOLOC_PROFILE_PRECEDENCE_NAME = 'geoloc_profile_precedence_values'

Definition at line 29 of file 2b45fd748a4f_add_geolocation_tables.py.

◆ GEOLOC_PROFILE_PRECEDENCE_VALUES

list GEOLOC_PROFILE_PRECEDENCE_VALUES = ['prefer_incoming', 'prefer_config', 'discard_incoming','discard_config']

Definition at line 30 of file 2b45fd748a4f_add_geolocation_tables.py.

◆ revision

str revision = '2b45fd748a4f'

Definition at line 10 of file 2b45fd748a4f_add_geolocation_tables.py.