File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -416,7 +416,7 @@ private static function initSchema(Connection $connection): void
416
416
417
417
$ db ->table ('artists ' )
418
418
->column ('id ' )->integer ()->primaryKey ()->autoIncrement ()
419
- ->column ('children ' )->array ()->null ()
419
+ ->column ('children ' )->array ()->null () //used to test conflicts with autopivot
420
420
->column ('name ' )->string ();
421
421
422
422
$ db ->table ('albums ' )
@@ -438,11 +438,15 @@ private static function initSchema(Connection $connection): void
438
438
->column ('track_id ' )->references ('tracks ' )
439
439
->column ('artist_id ' )->references ('artists ' )->comment ('@JsonKey("feat") @JsonInclude ' );
440
440
441
- $ db ->table ('artists_relations ' )
441
+ $ db ->table ('artists_relations ' ) //used to test the auto pivot case
442
442
->column ('id ' )->integer ()->primaryKey ()->autoIncrement ()
443
443
->column ('parent_id ' )->references ('artists ' )
444
444
->column ('child_id ' )->references ('artists ' );
445
445
446
+ $ db ->table ('children ' ) //used to test conflicts with autopivot
447
+ ->column ('id ' )->integer ()->primaryKey ()->autoIncrement ()
448
+ ->column ('artist_id ' )->references ('artists ' );
449
+
446
450
$ db ->junctionTable ('person ' , 'boats ' );
447
451
448
452
$ db ->table ('base_objects ' )
Original file line number Diff line number Diff line change @@ -2164,8 +2164,9 @@ public function testLazyStopRecursionOnCompositeForeignKey(): void
2164
2164
public function testMethodNameConflictsBetweenRegularAndAutoPivotProperties ()
2165
2165
{
2166
2166
$ artist = new ArtistBean ('Super ' );
2167
- $ artist ->getChildren ();
2168
- $ artist ->getChildrenByArtistsRelations ();
2167
+ $ artist ->getChildren (); // regular property
2168
+ $ artist ->getChildrenByArtistId (); // one-to-may relationship
2169
+ $ artist ->getChildrenByArtistsRelations (); // auto-pivot relationship
2169
2170
$ this ->assertEquals (1 , 1 );
2170
2171
}
2171
2172
}
You can’t perform that action at this time.
0 commit comments