Comment 11 for bug 1252693

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.db (master)

Reviewed: https://review.openstack.org/93414
Committed: https://git.openstack.org/cgit/openstack/oslo.db/commit/?id=528e406053ac9dfc5ee1348cf1ee64220ad0c1ce
Submitter: Jenkins
Branch: master

commit 528e406053ac9dfc5ee1348cf1ee64220ad0c1ce
Author: Ilya Pekelny <email address hidden>
Date: Tue May 13 14:16:44 2014 +0300

    Fix changing the type of column deleted

    SQLite doesn't provide a native implementation of BOOLEAN data type.
    SQLAlchemy emulates BOOLEAN data type for SQLite using INT column +
    a CHECK constraint.

    We've been providing a helper util to change the type of column
    'deleted' from BOOLEAN to INT. Due to limitations of ALTER in SQLite,
    in order to do that, we omit the original 'deleted' column as well as
    the corresponding CHECK constraint when recreating the table.
    Omitting of the constraint is more tricky, though. It's implemented
    by analyzing the SQL text used for its rendering. SQLAlchemy
    versions 0.8.3+ slightly changed the way constraints are rendered, so
    we have to update our util changing the type of 'deleted' column to
    work with SQLAlchemy 0.8.3+ on SQLite backend (we aren't using SQLite
    in production, but we still need it for running of unit tests).

    Closes-Bug: #1252693

    Change-Id: Ie92caff005217250de17461f4f87692ad8e96a09