From 259538d92f05e923c54dcb6791b3f4ed2753fc28 Mon Sep 17 00:00:00 2001 From: BANASHANKAR KALEBELAGUNDI VEERA Date: Fri, 22 Jan 2016 00:13:04 -0800 Subject: [PATCH] Change the length of name in the algorithm since we are updating the lenght of the lb_algorithm in pool table we need to change the name column in algorithm table as its a FK Closes-Bug:1536876 Change-Id: I1183da8e4effbf84c55618aa22b82dcc359b8623 --- .../43287cd10fef_make_pool_lb_algorithm_larger.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py b/octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py index 4ae3f0a30e..007e2fb26d 100644 --- a/octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py +++ b/octavia/db/migration/alembic_migrations/versions/43287cd10fef_make_pool_lb_algorithm_larger.py @@ -29,5 +29,15 @@ import sqlalchemy as sa def upgrade(): + op.drop_constraint( + u'fk_pool_algorithm_name', u'pool', + type_=u'foreignkey' + ) + op.alter_column(u'algorithm', u'name', nullable=False, + existing_type=sa.String(255)) op.alter_column(u'pool', u'lb_algorithm', nullable=False, existing_type=sa.String(255)) + op.create_foreign_key( + u'fk_pool_algorithm_name', u'pool', + u'algorithm', [u'lb_algorithm'], [u'name'] + )