diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml
index 73bec1912e1..5e025ce9dd6 100644
--- a/.github/workflows/coding-standards.yml
+++ b/.github/workflows/coding-standards.yml
@@ -24,4 +24,4 @@ on:
jobs:
coding-standards:
- uses: "doctrine/.github/.github/workflows/coding-standards.yml@13.0.0"
+ uses: "doctrine/.github/.github/workflows/coding-standards.yml@13.1.0"
diff --git a/.github/workflows/composer-lint.yml b/.github/workflows/composer-lint.yml
index 9290eafb3fb..ab0f6b1e81c 100644
--- a/.github/workflows/composer-lint.yml
+++ b/.github/workflows/composer-lint.yml
@@ -17,4 +17,4 @@ on:
jobs:
composer-lint:
name: "Composer Lint"
- uses: "doctrine/.github/.github/workflows/composer-lint.yml@13.0.0"
+ uses: "doctrine/.github/.github/workflows/composer-lint.yml@13.1.0"
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 7d53209fb35..5d0634394e5 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -1,4 +1,4 @@
-name: "CI"
+name: "CI: PHPUnit"
on:
pull_request:
@@ -25,7 +25,14 @@ env:
jobs:
phpunit-smoke-check:
- name: "PHPUnit with SQLite"
+ name: >
+ SQLite -
+ ${{ format('PHP {0} - DBAL {1} - ext. {2} - proxy {3}',
+ matrix.php-version || 'Ø',
+ matrix.dbal-version || 'Ø',
+ matrix.extension || 'Ø',
+ matrix.proxy || 'Ø'
+ ) }}
runs-on: "ubuntu-22.04"
strategy:
@@ -143,7 +150,7 @@ jobs:
ENABLE_NATIVE_LAZY_OBJECTS: ${{ matrix.native_lazy }}
- name: "Upload coverage file"
- uses: "actions/upload-artifact@v5"
+ uses: "actions/upload-artifact@v6"
with:
name: "phpunit-${{ matrix.extension }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-${{ matrix.deps }}-${{ matrix.stability }}-${{ matrix.native_lazy }}-coverage"
path: "coverage*.xml"
@@ -184,7 +191,13 @@ jobs:
phpunit-postgres:
- name: "PHPUnit with PostgreSQL"
+ name: >
+ ${{ format('PostgreSQL {0} - PHP {1} - DBAL {2} - ext. {3}',
+ matrix.postgres-version || 'Ø',
+ matrix.php-version || 'Ø',
+ matrix.dbal-version || 'Ø',
+ matrix.extension || 'Ø'
+ ) }}
runs-on: "ubuntu-22.04"
needs: "phpunit-smoke-check"
@@ -252,14 +265,20 @@ jobs:
run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_pgsql.xml --coverage-clover=coverage.xml"
- name: "Upload coverage file"
- uses: "actions/upload-artifact@v5"
+ uses: "actions/upload-artifact@v6"
with:
name: "${{ github.job }}-${{ matrix.postgres-version }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-${{ matrix.extension }}-coverage"
path: "coverage.xml"
phpunit-mariadb:
- name: "PHPUnit with MariaDB"
+ name: >
+ ${{ format('MariaDB {0} - PHP {1} - DBAL {2} - ext. {3}',
+ matrix.mariadb-version || 'Ø',
+ matrix.php-version || 'Ø',
+ matrix.dbal-version || 'Ø',
+ matrix.extension || 'Ø'
+ ) }}
runs-on: "ubuntu-22.04"
needs: "phpunit-smoke-check"
@@ -320,14 +339,20 @@ jobs:
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml"
- name: "Upload coverage file"
- uses: "actions/upload-artifact@v5"
+ uses: "actions/upload-artifact@v6"
with:
name: "${{ github.job }}-${{ matrix.mariadb-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage"
path: "coverage.xml"
phpunit-mysql:
- name: "PHPUnit with MySQL"
+ name: >
+ ${{ format('MySQL {0} - PHP {1} - DBAL {2} - ext. {3}',
+ matrix.mysql-version || 'Ø',
+ matrix.php-version || 'Ø',
+ matrix.dbal-version || 'Ø',
+ matrix.extension || 'Ø'
+ ) }}
runs-on: "ubuntu-22.04"
needs: "phpunit-smoke-check"
@@ -417,7 +442,7 @@ jobs:
ENABLE_SECOND_LEVEL_CACHE: 1
- name: "Upload coverage files"
- uses: "actions/upload-artifact@v5"
+ uses: "actions/upload-artifact@v6"
with:
name: "${{ github.job }}-${{ matrix.mysql-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-${{ matrix.dbal-version }}-coverage"
path: "coverage*.xml"
@@ -440,7 +465,7 @@ jobs:
fetch-depth: 2
- name: "Download coverage files"
- uses: "actions/download-artifact@v6"
+ uses: "actions/download-artifact@v7"
with:
path: "reports"
diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml
index 6825494ccff..31099928407 100644
--- a/.github/workflows/documentation.yml
+++ b/.github/workflows/documentation.yml
@@ -17,4 +17,4 @@ on:
jobs:
documentation:
name: "Documentation"
- uses: "doctrine/.github/.github/workflows/documentation.yml@13.0.0"
+ uses: "doctrine/.github/.github/workflows/documentation.yml@13.1.0"
diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml
index ad5c658d9c7..d3680ceafb9 100644
--- a/.github/workflows/release-on-milestone-closed.yml
+++ b/.github/workflows/release-on-milestone-closed.yml
@@ -7,7 +7,7 @@ on:
jobs:
release:
- uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@13.0.0"
+ uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@13.1.0"
secrets:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
diff --git a/UPGRADE.md b/UPGRADE.md
index 5c4808604b0..06190a641cc 100644
--- a/UPGRADE.md
+++ b/UPGRADE.md
@@ -29,6 +29,95 @@ and directly start using native lazy objects.
# Upgrade to 3.6
+## Deprecate using string expression for default values in mappings
+
+Using a string expression for default values in field mappings is deprecated.
+Use `Doctrine\DBAL\Schema\DefaultExpression` instances instead.
+
+Here is how to address this deprecation when mapping entities using PHP attributes:
+
+```diff
+ use DateTime;
++use Doctrine\DBAL\Schema\DefaultExpression\CurrentDate;
++use Doctrine\DBAL\Schema\DefaultExpression\CurrentTime;
++use Doctrine\DBAL\Schema\DefaultExpression\CurrentTimestamp;
+ use Doctrine\ORM\Mapping as ORM;
+
+ #[ORM\Entity]
+ final class TimeEntity
+ {
+ #[ORM\Id]
+ #[ORM\Column]
+ public int $id;
+
+- #[ORM\Column(options: ['default' => 'CURRENT_TIMESTAMP'], insertable: false, updatable: false)]
++ #[ORM\Column(options: ['default' => new CurrentTimestamp()], insertable: false, updatable: false)]
+ public DateTime $createdAt;
+
+- #[ORM\Column(options: ['default' => 'CURRENT_TIME'], insertable: false, updatable: false)]
++ #[ORM\Column(options: ['default' => new CurrentTime()], insertable: false, updatable: false)]
+ public DateTime $createdTime;
+
+- #[ORM\Column(options: ['default' => 'CURRENT_DATE'], insertable: false, updatable: false)]
++ #[ORM\Column(options: ['default' => new CurrentDate()], insertable: false, updatable: false)]
+ public DateTime $createdDate;
+ }
+```
+
+Here is how to do the same when mapping entities using XML:
+
+```diff
+
+
+
+
+
+
+
+
+
+
+
+-
++
+
+
+
+
+
+-
++
+
+
+
+
+
+-
++
+
+
+
+
+-
++
+
+
+
+
+```
+
+
## Deprecate `FieldMapping::$default`
The `default` property of `Doctrine\ORM\Mapping\FieldMapping` is deprecated and
diff --git a/docs/en/reference/attributes-reference.rst b/docs/en/reference/attributes-reference.rst
index ded3a28902d..78a13c037bf 100644
--- a/docs/en/reference/attributes-reference.rst
+++ b/docs/en/reference/attributes-reference.rst
@@ -668,11 +668,6 @@ and in the Context of a :ref:`#[ManyToMany] `. If this attri
are missing they will be computed considering the field's name and the current
:doc:`naming strategy `.
-The ``#[InverseJoinColumn]`` is the same as ``#[JoinColumn]`` and is used in the context
-of a ``#[ManyToMany]`` attribute declaration to specifiy the details of the join table's
-column information used for the join to the inverse entity. This is only required
-on PHP 8.0, where nested attributes are not yet supported.
-
Optional parameters:
- **name**: Column name that holds the foreign key identifier for
diff --git a/docs/en/reference/basic-mapping.rst b/docs/en/reference/basic-mapping.rst
index b1dfe8d9f7e..3a4fee03c60 100644
--- a/docs/en/reference/basic-mapping.rst
+++ b/docs/en/reference/basic-mapping.rst
@@ -190,6 +190,22 @@ PHP class, Doctrine also allows you to specify default values for
database columns using the ``default`` key in the ``options`` array of
the ``Column`` attribute.
+When using XML, you can specify object instances using the ``