Fix Alembic upgrades.

A non-existent constraint was being referenced in the upgrade script.
This patch corrects the problem by removing the reference.

This patch fixes another realtime problem as well. Our Alembic scripts
store booleans as yes or no values. However, Sorcery tries to insert
"true" or "false" instead. This patch updates Sorcery to use "yes" and
"no"

ASTERISK-26128 #close

Change-Id: I366dbbf91418a9cb160b3ca74b0e59b5ac284bec
This commit is contained in:
Mark Michelson
2016-06-20 13:18:38 -05:00
parent fe8aab6959
commit 1b79e2deff
5 changed files with 35 additions and 3 deletions

View File

@@ -16,10 +16,8 @@ import sqlalchemy as sa
def upgrade():
op.add_column('ps_contacts', sa.Column('reg_server', sa.String(20)))
op.drop_constraint('id', 'ps_contacts', type_='unique')
op.create_unique_constraint('ps_contacts_uq', 'ps_contacts', ['id','reg_server'])
def downgrade():
op.drop_constraint('ps_contacts_uq', 'ps_contacts', type_='unique')
op.drop_column('ps_contacts', 'reg_server')
op.create_unique_constraint(None, 'ps_contacts', 'id')