Skip to content

Commit 1475df5

Browse files
committed
Deeper Composite FK: Test Case
1 parent a20710b commit 1475df5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/TDBMAbstractServiceTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,12 @@ private static function initSchema(Connection $connection): void
458458
->column('id')->integer()->primaryKey()->autoIncrement()
459459
->column('base_object_id')->references('base_objects')->unique()->comment('@JsonCollection');
460460

461+
$db->table('composite_fk_target_reference')
462+
->column('id')->integer()->primaryKey()->autoIncrement()
463+
->column('label')->string();
464+
461465
$targetTable = $db->table('composite_fk_target')
462-
->column('id_1')->integer()
466+
->column('id_1')->references('composite_fk_target_reference')
463467
->column('id_2')->integer()
464468
->then()->primaryKey(['id_1', 'id_2']);
465469
$db->table('composite_fk_source')
@@ -800,6 +804,10 @@ private static function initSchema(Connection $connection): void
800804
'person_id' => 1,
801805
'boat_id' => 1,
802806
]);
807+
self::insert($connection, 'composite_fk_target_reference', [
808+
'id' => 1,
809+
'label' => 'test'
810+
]);
803811
self::insert($connection, 'composite_fk_target', [
804812
'id_1' => 1,
805813
'id_2' => 1

0 commit comments

Comments
 (0)