mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 01:54:04 +00:00
debug
This commit is contained in:
parent
8c87dde85d
commit
b0effa60e7
1 changed files with 2 additions and 2 deletions
|
|
@ -162,7 +162,9 @@ test('global scope is not applied when using rls', function () {
|
||||||
|
|
||||||
test('queries are correctly scoped using RLS', function() {
|
test('queries are correctly scoped using RLS', function() {
|
||||||
// Create rls policies for tables
|
// Create rls policies for tables
|
||||||
|
dump('creating rls policies', tenancy()->getTenantModels());
|
||||||
pest()->artisan('tenants:create-rls-policies');
|
pest()->artisan('tenants:create-rls-policies');
|
||||||
|
dump('policies created', DB::select('select * from pg_policies'));
|
||||||
|
|
||||||
// Create two tenants with postgres users
|
// Create two tenants with postgres users
|
||||||
$tenant = Tenant::create();
|
$tenant = Tenant::create();
|
||||||
|
|
@ -174,8 +176,6 @@ test('queries are correctly scoped using RLS', function() {
|
||||||
// Create posts and comments for both tenants
|
// Create posts and comments for both tenants
|
||||||
tenancy()->initialize($tenant);
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
dd(DB::select('select * from pg_policies'));
|
|
||||||
|
|
||||||
$post1 = RlsPost::create(['text' => 'first post']);
|
$post1 = RlsPost::create(['text' => 'first post']);
|
||||||
$post1Comment = $post1->scoped_comments()->create(['text' => 'first comment']);
|
$post1Comment = $post1->scoped_comments()->create(['text' => 'first comment']);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue