This is an existing issue in python migra: djrobstep/migra#234
When using RLS, the security_invoker setting on a view can be critical, but migra omits it. This is exceptionally dangerous because, with default view ownership including BYPASSRLS permission, by default it causes me to leak sensitive data.
Given:
CREATE OR REPLACE my_view WITH ( security_invoker = TRUE ) AS ... against an empty db
Expected:
CREATE OR REPLACE my_view WITH ( security_invoker = TRUE ) AS ...
Actual
CREATE OR REPLACE my_view AS ...