summaryrefslogtreecommitdiff
path: root/contrib/ast-db-manage/voicemail.ini.sample
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2016-03-01 19:03:04 -0700
committerGeorge Joseph <george.joseph@fairview5.com>2016-03-02 15:48:27 -0700
commit86d6e44cc1ebc1c0e4ed5cf872ca9416d276c038 (patch)
tree70a7f807961332fef89f3ca6df2ba720cc7c4754 /contrib/ast-db-manage/voicemail.ini.sample
parentd1495bc0ebed86d322488bed647b43aba0ae9b1f (diff)
alembic: Fix downgrade and tweak for sqlite
Downgrade had a few issues. First there was an errant 'update' statement in add_auto_dtmf_mode that looks like it was a copy/paste error. Second, we weren't cleaning up the ENUMs so subsequent upgrades on postgres failed because the types already existed. For sqlite... sqlite doesn't support ALTER or DROP COLUMN directly. Fortunately alembic batch_operations takes care of this for us if we use it so the alter and drops were converted to use batch operations. Here's an example downgrade: with op.batch_alter_table('ps_endpoints') as batch_op: batch_op.drop_column('tos_audio') batch_op.drop_column('tos_video') batch_op.add_column(sa.Column('tos_audio', yesno_values)) batch_op.add_column(sa.Column('tos_video', yesno_values)) batch_op.drop_column('cos_audio') batch_op.drop_column('cos_video') batch_op.add_column(sa.Column('cos_audio', yesno_values)) batch_op.add_column(sa.Column('cos_video', yesno_values)) with op.batch_alter_table('ps_transports') as batch_op: batch_op.drop_column('tos') batch_op.add_column(sa.Column('tos', yesno_values)) # Can't cast integers to YESNO_VALUES, so dropping and adding is required batch_op.drop_column('cos') batch_op.add_column(sa.Column('cos', yesno_values)) Upgrades from base to head and downgrades from head to base were tested repeatedly for postgresql, mysql/mariadb, and sqlite3. Change-Id: I862b0739eb3fd45ec3412dcc13c2340e1b7baef8
Diffstat (limited to 'contrib/ast-db-manage/voicemail.ini.sample')
0 files changed, 0 insertions, 0 deletions