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
changes/17/3317/1
Mark Michelson 9 years ago
parent 2949e674a5
commit 76781a0964

@ -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))

Loading…
Cancel
Save