bug blocks DB migration that changes column type
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I'm trying to make the following change as a DB migration
+ # Table instances, modify field 'vcpus_used' to Float
+ compute_nodes = Table('
+ vcpus_used = getattr(
+ vcpus_used.
This works at runtime (using PostgreSQL) but when running the unit tests (using sqlite) I get the following:
nova.tests.
-------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "/home/
"Models and migration scripts aren't in sync:\n%s" % msg)
File "/home/
raise self.failureExc
AssertionError: Models and migration scripts aren't in sync:
[ ( 'add_constraint',
This appears to be an interaction between two things, the change I made to alter the vcpus_used column, and a previous change (commit 2db4a1ac, migration version 279) to add the uniq_compute_
I suspect that this means that anyone wanting to change the type of a column in the "compute_nodes" table (or possibly any table with a similar constraint) will run into a similar problem.
Changed in nova: | |
status: | New → Invalid |
alaski pointed out that the constraint doesn't even touch the column that I'm trying to alter, so there must be something else going on. One possibility is that we're actually recreating the entire table, not just the column being altered.