def METHOD_NAME():
    ############################# Enums ##############################
    # yesno_values have already been created, so use postgres enum object
    # type to get around "already created" issue - works okay with mysql
    yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
    # for some reason when using 'add_column' if you don't create the enum
    # first it will think it already exists and fail
    pjsip_redirect_method_values = sa.Enum(
        *PJSIP_REDIRECT_METHOD_VALUES, name=PJSIP_REDIRECT_METHOD_NAME)
    check = False if context.is_offline_mode() else True
    pjsip_redirect_method_values.create(op.get_bind(), checkfirst=check)
    pjsip_transport_method_values = sa.Enum(
        *PJSIP_TRANSPORT_METHOD_VALUES, name=PJSIP_TRANSPORT_METHOD_NAME)
    pjsip_transport_protocol_values = sa.Enum(
        *PJSIP_TRANSPORT_PROTOCOL_VALUES, name=PJSIP_TRANSPORT_PROTOCOL_NAME)
    ######################### create tables ##########################
    op.create_table(
        'ps_systems',
        sa.Column('id', sa.String(40), nullable=False, unique=True),
        sa.Column('timer_t1', sa.Integer),
        sa.Column('timer_b', sa.Integer),
        sa.Column('compact_headers', yesno_values),
        sa.Column('threadpool_initial_size', sa.Integer),
        sa.Column('threadpool_auto_increment', sa.Integer),
        sa.Column('threadpool_idle_timeout', sa.Integer),
        sa.Column('threadpool_max_size', sa.Integer),
    )
    op.create_index('ps_systems_id', 'ps_systems', ['id'])
    op.create_table(
        'ps_globals',
        sa.Column('id', sa.String(40), nullable=False, unique=True),
        sa.Column('max_forwards', sa.Integer),
        sa.Column('user_agent', sa.String(40)),
        sa.Column('default_outbound_endpoint', sa.String(40)),
    )
    op.create_index('ps_globals_id', 'ps_globals', ['id'])
    op.create_table(
        'ps_transports',
        sa.Column('id', sa.String(40), nullable=False, unique=True),
        sa.Column('async_operations', sa.Integer),
        sa.Column('bind', sa.String(40)),
        sa.Column('ca_list_file', sa.String(200)),
        sa.Column('cert_file', sa.String(200)),
        sa.Column('cipher', sa.String(200)),
        sa.Column('domain', sa.String(40)),
        sa.Column('external_media_address', sa.String(40)),
        sa.Column('external_signaling_address', sa.String(40)),
        sa.Column('external_signaling_port', sa.Integer),
        sa.Column('method', pjsip_transport_method_values),
        sa.Column('local_net', sa.String(40)),
        sa.Column('password', sa.String(40)),
        sa.Column('priv_key_file', sa.String(200)),
        sa.Column('protocol', pjsip_transport_protocol_values),
        sa.Column('require_client_cert', yesno_values),
        sa.Column('verify_client', yesno_values),
        sa.Column('verifiy_server', yesno_values),
        sa.Column('tos', yesno_values),
        sa.Column('cos', yesno_values),
    )
    op.create_index('ps_transports_id', 'ps_transports', ['id'])
    op.create_table(
        'ps_registrations',
        sa.Column('id', sa.String(40), nullable=False, unique=True),
        sa.Column('auth_rejection_permanent', yesno_values),
        sa.Column('client_uri', sa.String(40)),
        sa.Column('contact_user', sa.String(40)),
        sa.Column('expiration', sa.Integer),
        sa.Column('max_retries', sa.Integer),
        sa.Column('outbound_auth', sa.String(40)),
        sa.Column('outbound_proxy', sa.String(40)),
        sa.Column('retry_interval', sa.Integer),
        sa.Column('forbidden_retry_interval', sa.Integer),
        sa.Column('server_uri', sa.String(40)),
        sa.Column('transport', sa.String(40)),
        sa.Column('support_path', yesno_values),
    )
    op.create_index('ps_registrations_id', 'ps_registrations', ['id'])
    ########################## add columns ###########################
    # new columns for endpoints
    op.add_column('ps_endpoints', sa.Column('media_address', sa.String(40)))
    op.add_column('ps_endpoints', sa.Column('redirect_method',
        pjsip_redirect_method_values))
    op.add_column('ps_endpoints', sa.Column('set_var', sa.Text()))
    # rename mwi_fromuser to mwi_from_user
    op.alter_column('ps_endpoints', 'mwi_fromuser',
        new_column_name='mwi_from_user', existing_type=sa.String(40))
    # new columns for contacts
    op.add_column('ps_contacts', sa.Column('outbound_proxy', sa.String(40)))
    op.add_column('ps_contacts', sa.Column('path', sa.Text()))
    # new columns for aors
    op.add_column('ps_aors', sa.Column('maximum_expiration', sa.Integer))
    op.add_column('ps_aors', sa.Column('outbound_proxy', sa.String(40)))
    op.add_column('ps_aors', sa.Column('support_path', yesno_values))