mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 12:04:04 +00:00
Merge 61410b52d4 into e0990a438c
This commit is contained in:
commit
8a8f5a6189
4 changed files with 11 additions and 11 deletions
|
|
@ -582,7 +582,7 @@ test('table rls manager generates queries correctly', function() {
|
|||
expect(array_values(app(TableRLSManager::class)->generateQueries()))->toEqualCanonicalizing([
|
||||
<<<SQL
|
||||
CREATE POLICY authors_rls_policy ON authors USING (
|
||||
tenant_id::text = current_setting('my.current_tenant')
|
||||
tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
);
|
||||
SQL,
|
||||
<<<SQL
|
||||
|
|
@ -590,7 +590,7 @@ test('table rls manager generates queries correctly', function() {
|
|||
author_id IN (
|
||||
SELECT id
|
||||
FROM authors
|
||||
WHERE tenant_id::text = current_setting('my.current_tenant')
|
||||
WHERE tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
)
|
||||
);
|
||||
SQL,
|
||||
|
|
@ -602,7 +602,7 @@ test('table rls manager generates queries correctly', function() {
|
|||
WHERE author_id IN (
|
||||
SELECT id
|
||||
FROM authors
|
||||
WHERE tenant_id::text = current_setting('my.current_tenant')
|
||||
WHERE tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
@ -652,7 +652,7 @@ test('table rls manager generates queries correctly', function() {
|
|||
expect(app(TableRLSManager::class)->generateQueries($paths))->toContain(
|
||||
<<<SQL
|
||||
CREATE POLICY primaries_rls_policy ON primaries USING (
|
||||
tenant_id::text = current_setting('my.current_tenant')
|
||||
tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
);
|
||||
SQL,
|
||||
<<<SQL
|
||||
|
|
@ -660,7 +660,7 @@ test('table rls manager generates queries correctly', function() {
|
|||
primary_id IN (
|
||||
SELECT id
|
||||
FROM primaries
|
||||
WHERE tenant_id::text = current_setting('my.current_tenant')
|
||||
WHERE tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
)
|
||||
);
|
||||
SQL,
|
||||
|
|
@ -672,7 +672,7 @@ test('table rls manager generates queries correctly', function() {
|
|||
WHERE primary_id IN (
|
||||
SELECT id
|
||||
FROM primaries
|
||||
WHERE tenant_id::text = current_setting('my.current_tenant')
|
||||
WHERE tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ test('trait rls manager generates queries correctly', function() {
|
|||
expect($manager->generateQueries())->toContain(
|
||||
<<<SQL
|
||||
CREATE POLICY posts_rls_policy ON posts USING (
|
||||
tenant_id::text = current_setting('my.current_tenant')
|
||||
tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
);
|
||||
SQL,
|
||||
<<<SQL
|
||||
|
|
@ -287,7 +287,7 @@ test('trait rls manager generates queries correctly', function() {
|
|||
post_id IN (
|
||||
SELECT id
|
||||
FROM posts
|
||||
WHERE tenant_id::text = current_setting('my.current_tenant')
|
||||
WHERE tenant_id::text = (select current_setting('my.current_tenant'))
|
||||
)
|
||||
);
|
||||
SQL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue