This patch fixes the use of the deleted column for the PolicyRule.
Even though the 'deleted' attribute for the DB model is a literal,
the flag being passed around is a boolean. This causes a mismatch
between the conceptual model and the logical schema that may lead
to errors depending on the actual DB backend. For instance MySql
is fine, but Postgres is not.
Furthermore, soft deletes were also not represented correctly during
the initialization of the policy rule, as when a rule is soft deleted,
the deleted literal is a representation of the entity's uuid, rather
than a simple bool.
This patch also makes sure that from a DB schema migration, the
right defaults are captured.
Finally, the db module has been extended to allow the retrieval
of soft deleted rules, as a future-proofing measure.
Reviewed: https:/ /review. openstack. org/136206 /git.openstack. org/cgit/ stackforge/ congress/ commit/ ?id=745fca19946 0d0c5a5a2ef49e0 8a78dde9367910
Committed: https:/
Submitter: Jenkins
Branch: master
commit 745fca199460d0c 5a5a2ef49e08a78 dde9367910
Author: armando-migliaccio <email address hidden>
Date: Thu Nov 20 15:20:55 2014 -0800
Fix Postgres support for Congress
This patch fixes the use of the deleted column for the PolicyRule.
Even though the 'deleted' attribute for the DB model is a literal,
the flag being passed around is a boolean. This causes a mismatch
between the conceptual model and the logical schema that may lead
to errors depending on the actual DB backend. For instance MySql
is fine, but Postgres is not.
Furthermore, soft deletes were also not represented correctly during
the initialization of the policy rule, as when a rule is soft deleted,
the deleted literal is a representation of the entity's uuid, rather
than a simple bool.
This patch also makes sure that from a DB schema migration, the
right defaults are captured.
Finally, the db module has been extended to allow the retrieval
of soft deleted rules, as a future-proofing measure.
Closes-bug: #1394319
Change-Id: Ifce2506d95b68e f168d53f7f59777 34f378c43df