Squarespace / pgbedrock

Manage a Postgres cluster's roles, role memberships, schema ownership, and privileges
https://pgbedrock.readthedocs.io/en/latest/
Other
313 stars 35 forks source link

Refactor obj owner queries #21

Closed zcmarine closed 6 years ago

zcmarine commented 6 years ago

This PR is in preparation for supporting table and sequence ownership (Issue #4).

It combines three queries that are almost identical:

In addition to combining these queries, the downstream methods that use them had to be rewritten to facilitate using a single source.

cpdean commented 6 years ago

from what we caught up on offline, as long as the old methods that are now backed by the shared query are tested via something that isn't insulated by a mock, this is probably good because I trust your test coverage.

zcmarine commented 6 years ago

Ok, verified that: 1) All modified methods are backed by tests, that many of those tests hit the test postgres, and that those tests all pass 2) Running this version of pgbedrock in check mode against a complex staging database shows the same change set as the dockerized pgbedrock:0.1.3 does.