Models are out of sync with migrations

Bug #1415436 reported by Andrew Pashkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
High
Dmytro Dovbii

Bug Description

In Murano project, declarative models is out of sync with changes scripted in migrations.

For example:
1) Migration 004 amends field "package.description"
   from VARCHAR(512) to TEXT [3]. At the same time model declaration still
   reference "description" field as VARCHAR(512) [4].

[3] https://review.openstack.org/gitweb?p=stackforge/murano.git;a=blob;f=murano/db/migration/alembic_migrations/versions/004_change_package_desc_type.py;h=9e46282e8c695c3b3147304e31076731a5bdf358;hb=HEAD#l65
[4] https://review.openstack.org/gitweb?p=stackforge/murano.git;a=blob;f=murano/db/models.py;h=e176b2acca516365fc243e9813e76eb5638ebd83;hb=HEAD#l223

2) Alembic has capabilities to find out differences between
   models and actual DB structure.
   And it shows that such differences are exist:
     - Checkout Murano
     - Configure it to use MySQL
     - Execute
         tox -e venv -- murano-db-manage --config-file ./etc/murano/murano.conf upgrade
     - Execute
         tox -e venv -- murano-db-manage --config-file ./etc/murano/murano.conf revision --autogenerate
     - Check out the new migration in "/murano/db/migration/alembic_migrations/versions".
       It refects differences between models and DB.

Revision: 987e897937ddf534770afa4ebfe7dfeeed6d8ade
Project: murano

summary: - Models is out of sync with migrations
+ Models are out of sync with migrations
description: updated
description: updated
Revision history for this message
Ekaterina Chernova (efedorova) wrote :

Do we agreed to replace current migrations so this bug will be obsolete after that?

Revision history for this message
Andrew Pashkin (apashkin) wrote :
Changed in murano:
assignee: nobody → Andrew Pashkin (apashkin)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/153285
Committed: https://git.openstack.org/cgit/stackforge/murano/commit/?id=2b4457ada949cbb8289d002f7696cd2886ec361e
Submitter: Jenkins
Branch: master

commit 2b4457ada949cbb8289d002f7696cd2886ec361e
Author: Andrew Pashkin <email address hidden>
Date: Thu Feb 5 18:03:07 2015 +0300

    Changed models to match migrations

    Some fields in models and in migrations was
    different.

    Closes-Bug: #1415436
    Change-Id: I4b8cbbea567d2a3a79f08ce9e72b4b3427719509

Changed in murano:
status: In Progress → Fix Committed
Changed in murano:
milestone: none → kilo-rc1
status: Fix Committed → In Progress
Changed in murano:
milestone: kilo-rc1 → liberty-1
Changed in murano:
importance: Undecided → High
Changed in murano:
status: In Progress → Confirmed
Changed in murano:
milestone: liberty-1 → kilo-rc1
Changed in murano:
assignee: Andrew Pashkin (apashkin) → nobody
Changed in murano:
milestone: kilo-rc1 → liberty-1
Changed in murano:
status: Confirmed → Fix Committed
Revision history for this message
Kirill Zaitsev (kzaitsev) wrote :

Actually they still are. There are inconsistencies in unique indices.

For example https://github.com/openstack/murano/blob/master/murano/db/models.py#L311 is wrong

Changed in murano:
status: Fix Committed → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

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

Changed in murano:
assignee: nobody → Dmytro Dovbii (ddovbii)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/185426
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=1a84e6f7296d532875bae07510826629aaba4566
Submitter: Jenkins
Branch: master

commit 1a84e6f7296d532875bae07510826629aaba4566
Author: Dmytro Dovbii <email address hidden>
Date: Mon May 25 19:38:57 2015 +0300

    Add unique constraint to environment table

    Change-Id: Ia491c957ebd29fb27614623e6f8ef6bd327e9449
    Partial-Bug: #1415436

Changed in murano:
status: In Progress → Fix Committed
Changed in murano:
status: Fix Committed → Fix Released
Changed in murano:
milestone: liberty-1 → 1.0.0
Changed in murano:
milestone: 1.0.0 → 1.0.1
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.