]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Replace soft_delete in volume_type_access_remove
authorMichal Dulko <michal.dulko@intel.com>
Mon, 21 Sep 2015 13:58:01 +0000 (15:58 +0200)
committerMichal Dulko <michal.dulko@intel.com>
Mon, 21 Sep 2015 14:09:01 +0000 (16:09 +0200)
commit0e66d3ea1ec83be3e42726063198183097d40cde
treeb5e83927fb7e1f835fc098a179943d96d89479c4
parent52e5ed72537f0e53130942be25557b2daa7d0c99
Replace soft_delete in volume_type_access_remove

This commit replaces oslo.db's soft_delete used in
volume_type_access_remove in db.api with a simple update setting
deleted column to True.

As deleted column is boolean it is represented in the DB by TINYINT,
which max value is 127. This introduces problems when removing records
with id higher than that, because soft_delete sets deleted column to the
value of id. This commit fixes the issue and adds unit tests for such
case.

Change-Id: I484e66125b5a29f490c070696b336be4a2693b3e
Closes-Bug: 1496747
cinder/db/sqlalchemy/api.py
cinder/tests/unit/test_db_api.py