Fix sqlalchemy error regarding identifier length.

sqlalchemy was complaining:

sqlalchemy.exc.IdentifierError: Identifier
'ps_contacts_qualifyfreq_exptime' exceeds maximum length of 30
characters

This fixes the problem by changing the index name to be
"ps_contacts_qualifyfreq_exp" instead.

ASTERISK-26227 #close
Reported by Mark Michelson

Change-Id: I0ed784f87504be2a59ee8d3242ef6f625d5ed1a9
This commit is contained in:
Mark Michelson
2016-07-22 14:44:50 -05:00
parent 8d6a7b89bd
commit eda95236d1

View File

@@ -24,10 +24,10 @@ def upgrade():
else:
op.execute('ALTER TABLE ps_contacts ALTER COLUMN expiration_time TYPE BIGINT USING expiration_time::bigint')
op.create_index('ps_contacts_qualifyfreq_exptime', 'ps_contacts', ['qualify_frequency', 'expiration_time'])
op.create_index('ps_contacts_qualifyfreq_exp', 'ps_contacts', ['qualify_frequency', 'expiration_time'])
op.create_index('ps_aors_qualifyfreq_contact', 'ps_aors', ['qualify_frequency', 'contact'])
def downgrade():
op.drop_index('ps_aors_qualifyfreq_contact')
op.drop_index('ps_contacts_qualifyfreq_exptime')
op.drop_index('ps_contacts_qualifyfreq_exp')
op.drop_column('ps_contacts', 'endpoint')
op.alter_column('ps_contacts', 'expiration_time', type_=sa.String(40))