mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 20:34:03 +00:00
Fix column definitions
This commit is contained in:
parent
2197214516
commit
578791018a
1 changed files with 3 additions and 3 deletions
|
|
@ -503,7 +503,7 @@ test('table rls manager generates relationship trees with tables related to the
|
||||||
|
|
||||||
// Add non-nullable comment_id foreign key
|
// Add non-nullable comment_id foreign key
|
||||||
Schema::table('ratings', function (Blueprint $table) {
|
Schema::table('ratings', function (Blueprint $table) {
|
||||||
$table->foreignId('comment_id')->onUpdate('cascade')->onDelete('cascade')->comment('rls')->constrained('comments');
|
$table->foreignId('comment_id')->comment('rls')->constrained('comments')->onUpdate('cascade')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Non-nullable paths are preferred over nullable paths
|
// Non-nullable paths are preferred over nullable paths
|
||||||
|
|
@ -640,11 +640,11 @@ test('table rls manager generates queries correctly', function() {
|
||||||
test('table manager throws an exception when encountering a recursive relationship', function() {
|
test('table manager throws an exception when encountering a recursive relationship', function() {
|
||||||
Schema::create('recursive_posts', function (Blueprint $table) {
|
Schema::create('recursive_posts', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('highlighted_comment_id')->constrained('comments')->nullable()->comment('rls');
|
$table->foreignId('highlighted_comment_id')->nullable()->comment('rls')->constrained('comments');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('comments', function (Blueprint $table) {
|
Schema::table('comments', function (Blueprint $table) {
|
||||||
$table->foreignId('recursive_post_id')->constrained('recursive_posts')->comment('rls');
|
$table->foreignId('recursive_post_id')->comment('rls')->constrained('recursive_posts');
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fn () => app(TableRLSManager::class)->generateTrees())->toThrow(RecursiveRelationshipException::class);
|
expect(fn () => app(TableRLSManager::class)->generateTrees())->toThrow(RecursiveRelationshipException::class);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue