False positive for "Using nullable columns (xxx) in a primary key index is deprecated."? #7540

Closed
opened 2026-01-22 15:53:11 +01:00 by admin · 1 comment
Owner

Originally created by @k00ni on GitHub (Aug 7, 2025).

Bug Report

Q A
Version 4.3.2

Summary

When running PHPUnit tests it shows false-positive deprecation warnings triggered by DBAL. I hope this is the correct repository, because this currently happens when also using Doctrine.

Ref: https://github.com/doctrine/dbal/pull/6787

Current behavior

It triggers deprecation warnings, even though related tables don't match the criteria.

Image

Here as text:

Remaining indirect deprecation notices (4)

  1x: Using nullable columns (GeoEintragTeilVonBeziehungVonEintrag.geoeintragteilvonbeziehung_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal)
    1x in DemoTest::test from Tests

  1x: Using nullable columns (GeoEintragTeilVonBeziehungVonEintrag.geoeintrag_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal)
    1x in DemoTest::test from Tests

  1x: Using nullable columns (GeoEintragTeilVonBeziehungZuEintrag.geoeintragteilvonbeziehung_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal)
    1x in DemoTest::test from Tests

  1x: Using nullable columns (GeoEintragTeilVonBeziehungZuEintrag.geoeintrag_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal)
    1x in DemoTest::test from Tests

All mentioned columns are being defined as NOT NULL, for instance:

Image

Expected behavior

No deprecation warnings at all.

How to reproduce

I added a reproducer:

https://github.com/k00ni/dbal-nullable-columns-primary-key

There is a basic workflow to demonstrate the deprecations:

https://github.com/k00ni/dbal-nullable-columns-primary-key/actions/runs/16804524077/job/47593473139#step:9:127

Originally created by @k00ni on GitHub (Aug 7, 2025). ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |-------------------------------------------- | ------ | Version | 4.3.2 #### Summary When running PHPUnit tests it shows false-positive deprecation warnings triggered by DBAL. I hope this is the correct repository, because this currently happens when also using Doctrine. Ref: https://github.com/doctrine/dbal/pull/6787 #### Current behavior It triggers deprecation warnings, even though related tables don't match the criteria. <img width="2233" height="521" alt="Image" src="https://github.com/user-attachments/assets/3c625627-8168-4e7f-a8ad-4c0de87ed67f" /> Here as text: ``` Remaining indirect deprecation notices (4) 1x: Using nullable columns (GeoEintragTeilVonBeziehungVonEintrag.geoeintragteilvonbeziehung_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal) 1x in DemoTest::test from Tests 1x: Using nullable columns (GeoEintragTeilVonBeziehungVonEintrag.geoeintrag_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal) 1x in DemoTest::test from Tests 1x: Using nullable columns (GeoEintragTeilVonBeziehungZuEintrag.geoeintragteilvonbeziehung_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal) 1x in DemoTest::test from Tests 1x: Using nullable columns (GeoEintragTeilVonBeziehungZuEintrag.geoeintrag_id) in a primary key index is deprecated. (Table.php:182 called by Table.php:199, https://github.com/doctrine/dbal/pull/6787, package doctrine/dbal) 1x in DemoTest::test from Tests ``` All mentioned columns are being defined as `NOT NULL`, for instance: <img width="1281" height="1070" alt="Image" src="https://github.com/user-attachments/assets/e5c289aa-5524-449a-afdb-686066dbade9" /> #### Expected behavior No deprecation warnings at all. #### How to reproduce I added a reproducer: https://github.com/k00ni/dbal-nullable-columns-primary-key There is a basic workflow to demonstrate the deprecations: https://github.com/k00ni/dbal-nullable-columns-primary-key/actions/runs/16804524077/job/47593473139#step:9:127
admin closed this issue 2026-01-22 15:53:11 +01:00
Author
Owner

@greg0ire commented on GitHub (Aug 7, 2025):

I hope this is the correct repository, because this currently happens when also using Doctrine.

I think by "Doctrine" you mean the ORM.

This is an ORM issue, and I'm pretty sure I have a fix. Transferred.

@greg0ire commented on GitHub (Aug 7, 2025): > I hope this is the correct repository, because this currently happens when also using Doctrine. I think by "Doctrine" you mean the ORM. This is an ORM issue, and I'm pretty sure I have a fix. Transferred.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7540