1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 12:24:04 +00:00

Fully cover shouldSkipPathLeadingThrough in tests

This commit is contained in:
lukinovec 2025-06-27 14:58:17 +02:00
parent 8934114f92
commit 84ac69c908

View file

@ -428,9 +428,15 @@ test('table rls manager generates shortest paths that lead to the tenants table
expect($manager->shortestPaths())->toEqual($expectedShortestPaths);
// Add non-nullable comment_id foreign key
// Add non-nullable comment_id comment constraint
Schema::table('ratings', function (Blueprint $table) {
$table->foreignId('comment_id')->comment('rls')->constrained('comments')->onUpdate('cascade')->onDelete('cascade');
$table->string('comment_id')->comment('rls comments.id');
// Nullable constraint with a non-RLS comment.
// Skipped when scopeByDefault is false,
// not ignored when scopeByDefault is true, but still,
// not preferred since comment_id is valid and non-nullable.
$table->foreignId('author_id')->nullable()->comment('random comment')->constrained('authors');
});
// Non-nullable paths are preferred over nullable paths