migration default value not being applied to dbase

Bug #1336556 reported by Paul Michali
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Eugene Nikanorov

Bug Description

I have a private repo that is a few weeks behind the upstream, and was having problems stacking. Initially it was failing in one of the migrations, so I changed the SQLAlchemy version to 0.8.4 and alembic to 0.6.5 and retried (clean database).

What I saw was that the migration worked, but later a router create failed. It was complaining that the enable_snat field was not specified and did not have a default value. Checking in the migrations, I saw that 128e042a2b68_ext_gw_mode.py adds this field and sets the default value to True. However, it was not doing that.

I changed the migration file to use server_default=sa.text("true") and now the migration works. BTW, it was the only migration file using 'default=True'.

Not sure if we should just apply this change to the existing migration file or if some other action is needed.

Tags: db migration
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

has the same issue: 40b0aff0302e_mlnx_initial.py

tags: added: db
Changed in neutron:
importance: Undecided → Medium
status: New → Confirmed
assignee: nobody → Eugene Nikanorov (enikanorov)
assignee: Eugene Nikanorov (enikanorov) → Sergey Kolekonov (skolekonov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/105212

Changed in neutron:
status: Confirmed → In Progress
Changed in neutron:
assignee: Sergey Kolekonov (skolekonov) → Eugene Nikanorov (enikanorov)
Kyle Mestery (mestery)
Changed in neutron:
milestone: none → juno-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/105212
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=b98dda29c9bf2587c2eddad0231e337a1cb4ce02
Submitter: Jenkins
Branch: master

commit b98dda29c9bf2587c2eddad0231e337a1cb4ce02
Author: Sergey Kolekonov <email address hidden>
Date: Mon Jul 7 19:22:25 2014 +0400

    Fix missing migration default value

    Fix 128e042a2b68_ext_gw_mode and 40b0aff0302e_mlnx_initial
    migrations by properly using server_default parameter in column
    definitions.

    Change-Id: I199e206dccc36fcfc2457a17167c76611d69784a
    Closes-bug: #1336556

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.