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: Ifce2506d95b68ef168d53f7f5977734f378c43df
Merge "Fix Postgres support for Congress"