1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-08-06 12:04:04 +00:00
This commit is contained in:
Dmitry Maranik 2026-08-05 15:52:56 +02:00 committed by GitHub
commit 8a8f5a6189
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 11 deletions

View file

@ -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'))
)
)
);

View file

@ -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,