This adds a new command to "sg migration" which will enable RLS on the tenant_id column. It relies on the introspection features already present in our migration store to automatically update any table which has the "tenant_id" column.
Additionally we provide functionality to disable the enforcement via the "--disable" flag.
Test Plan: "go run ./dev/sg migration enforce-tenant-id" with and without "--disable" specified. Then inspected the DB state to confirm the migrations run correctly.
This adds a new command to "sg migration" which will enable RLS on the tenant_id column. It relies on the introspection features already present in our migration store to automatically update any table which has the "tenant_id" column.
Additionally we provide functionality to disable the enforcement via the "--disable" flag.
Test Plan: "go run ./dev/sg migration enforce-tenant-id" with and without "--disable" specified. Then inspected the DB state to confirm the migrations run correctly.
Fixes https://linear.app/sourcegraph/issue/SPLF-211/easy-way-to-enable-rls-enforcement-for-dev